summaryrefslogtreecommitdiff
path: root/src/plugins/debugger/stackframe.cpp
diff options
context:
space:
mode:
authorRobert Loehning <robert.loehning@nokia.com>2010-08-13 20:54:17 +0200
committerRobert Loehning <robert.loehning@nokia.com>2010-08-13 20:54:17 +0200
commit84b6bb16fa226acba2ad221f92e22ea249576d6d (patch)
treee197d735f37cfacc9900108ce0f0cb9791214d16 /src/plugins/debugger/stackframe.cpp
parent04e7c491ebc4d2dd35b2e702e42f8dfbc2ee40e3 (diff)
downloadqt-creator-84b6bb16fa226acba2ad221f92e22ea249576d6d.tar.gz
Working around bug in Qt to show tooltips correctly.
This commit repeats 34f241c051d796600807c5ea473d943ddb2bb99a . Looks like that didn't survive the merge. Task-number: QTBUG-12057
Diffstat (limited to 'src/plugins/debugger/stackframe.cpp')
-rw-r--r--src/plugins/debugger/stackframe.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/plugins/debugger/stackframe.cpp b/src/plugins/debugger/stackframe.cpp
index 9a0797f821..dc7e45dec6 100644
--- a/src/plugins/debugger/stackframe.cpp
+++ b/src/plugins/debugger/stackframe.cpp
@@ -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>"