forked from qt-creator/qt-creator
Working around bug in Qt to show tooltips correctly.
Task-number: QTBUG-12057 Reviewed-by: Alessandro Portale
This commit is contained in:
@@ -39,6 +39,9 @@
|
|||||||
#include <QtCore/QFileInfo>
|
#include <QtCore/QFileInfo>
|
||||||
#include <QtCore/QDir>
|
#include <QtCore/QDir>
|
||||||
|
|
||||||
|
#include <QtGui/QToolTip>
|
||||||
|
#include <QtGui/QFontMetrics>
|
||||||
|
|
||||||
namespace Debugger {
|
namespace Debugger {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
@@ -76,12 +79,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>"
|
||||||
|
Reference in New Issue
Block a user