Working around bug in Qt to show tooltips correctly.

This commit repeats 34f241c051 . Looks like that didn't survive the merge.

Task-number: QTBUG-12057
This commit is contained in:
Robert Loehning
2010-08-13 20:54:17 +02:00
parent 04e7c491eb
commit 84b6bb16fa

View File

@@ -35,6 +35,9 @@
#include <QtCore/QDir>
#include <QtCore/QTextStream>
#include <QtGui/QToolTip>
#include <QtGui/QFontMetrics>
namespace Debugger {
namespace Internal {
@@ -78,12 +81,14 @@ QString StackFrame::toString() const
QString StackFrame::toToolTip() const
{
const QString filePath = QDir::toNativeSeparators(file);
QString res;
QTextStream str(&res);
str << "<html><body><table>"
<< "<tr><td>" << StackHandler::tr("Address:") << "</td><td>" << address << "</td></tr>"
<< "<tr><td>" << StackHandler::tr("Function:") << "</td><td>" << function << "</td></tr>"
<< "<tr><td>" << StackHandler::tr("File:") << "</td><td>" << QDir::toNativeSeparators(file) << "</td></tr>"
<< "<tr><td>" << StackHandler::tr("File:") << "</td><td width="
<< QFontMetrics(QToolTip::font()).width(filePath) << ">" << filePath << "</td></tr>"
<< "<tr><td>" << StackHandler::tr("Line:") << "</td><td>" << line << "</td></tr>"
<< "<tr><td>" << StackHandler::tr("From:") << "</td><td>" << from << "</td></tr>"
<< "<tr><td>" << StackHandler::tr("To:") << "</td><td>" << to << "</td></tr>"