Skip to content
Snippets Groups Projects
Commit 84b6bb16 authored by Robert Loehning's avatar Robert Loehning
Browse files

Working around bug in Qt to show tooltips correctly.

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

Task-number: QTBUG-12057
parent 04e7c491
No related branches found
No related tags found
No related merge requests found
...@@ -35,6 +35,9 @@ ...@@ -35,6 +35,9 @@
#include <QtCore/QDir> #include <QtCore/QDir>
#include <QtCore/QTextStream> #include <QtCore/QTextStream>
#include <QtGui/QToolTip>
#include <QtGui/QFontMetrics>
namespace Debugger { namespace Debugger {
namespace Internal { namespace Internal {
...@@ -78,12 +81,14 @@ QString StackFrame::toString() const ...@@ -78,12 +81,14 @@ QString StackFrame::toString() const
QString StackFrame::toToolTip() const QString StackFrame::toToolTip() const
{ {
const QString filePath = QDir::toNativeSeparators(file);
QString res; QString res;
QTextStream str(&res); QTextStream str(&res);
str << "<html><body><table>" str << "<html><body><table>"
<< "<tr><td>" << StackHandler::tr("Address:") << "</td><td>" << address << "</td></tr>" << "<tr><td>" << StackHandler::tr("Address:") << "</td><td>" << address << "</td></tr>"
<< "<tr><td>" << StackHandler::tr("Function:") << "</td><td>" << function << "</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("Line:") << "</td><td>" << line << "</td></tr>"
<< "<tr><td>" << StackHandler::tr("From:") << "</td><td>" << from << "</td></tr>" << "<tr><td>" << StackHandler::tr("From:") << "</td><td>" << from << "</td></tr>"
<< "<tr><td>" << StackHandler::tr("To:") << "</td><td>" << to << "</td></tr>" << "<tr><td>" << StackHandler::tr("To:") << "</td><td>" << to << "</td></tr>"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment