diff options
author | Francois Ferrand <thetypz@gmail.com> | 2014-09-05 16:12:15 +0200 |
---|---|---|
committer | Francois Ferrand <thetypz@gmail.com> | 2014-09-12 17:03:44 +0200 |
commit | 9c1f44e942caa722add82af4462315cea8ee2e17 (patch) | |
tree | 7b820cc0e6a08021861351a65ab0ebf37d882ebd /src/plugins/valgrind/memcheckerrorview.cpp | |
parent | 87bcfab099610d447b3b0d5b3378a7875e22594c (diff) |
[Valgrind] Use standard font for currently selected memcheck entry.
The current item was displayed using the hardcoded "monospace" font, so that the current/system
font and size was not used. We now use start with the same font as the error list, and simply
activate 'fixedPitch'.
Change-Id: Ifcf6f0fc044e47b3a57281f6af2d70b7f1c618e4
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Diffstat (limited to 'src/plugins/valgrind/memcheckerrorview.cpp')
-rw-r--r-- | src/plugins/valgrind/memcheckerrorview.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/plugins/valgrind/memcheckerrorview.cpp b/src/plugins/valgrind/memcheckerrorview.cpp index b1c3a94fb31..8df3bc688f3 100644 --- a/src/plugins/valgrind/memcheckerrorview.cpp +++ b/src/plugins/valgrind/memcheckerrorview.cpp @@ -94,7 +94,7 @@ private slots: private: // the constness of this function is a necessary lie because it is called from paint() const. - QWidget *createDetailsWidget(const QModelIndex &errorIndex, QWidget *parent) const; + QWidget *createDetailsWidget(const QFont &font, const QModelIndex &errorIndex, QWidget *parent) const; static const int s_itemMargin = 2; mutable QPersistentModelIndex m_detailsIndex; @@ -128,7 +128,7 @@ QSize MemcheckErrorDelegate::sizeHint(const QStyleOptionViewItem &opt, const QMo } if (!m_detailsWidget) { - m_detailsWidget = createDetailsWidget(index, view->viewport()); + m_detailsWidget = createDetailsWidget(opt.font, index, view->viewport()); QTC_ASSERT(m_detailsWidget->parent() == view->viewport(), m_detailsWidget->setParent(view->viewport())); m_detailsIndex = index; @@ -213,7 +213,7 @@ static QString errorLocation(const QModelIndex &index, const Error &error, link, linkAttr)); } -QWidget *MemcheckErrorDelegate::createDetailsWidget(const QModelIndex &errorIndex, QWidget *parent) const +QWidget *MemcheckErrorDelegate::createDetailsWidget(const QFont & font, const QModelIndex &errorIndex, QWidget *parent) const { QWidget *widget = new QWidget(parent); QVBoxLayout *layout = new QVBoxLayout; @@ -269,7 +269,10 @@ QWidget *MemcheckErrorDelegate::createDetailsWidget(const QModelIndex &errorInde p.setBrush(QPalette::Base, p.alternateBase()); frameLabel->setPalette(p); } - frameLabel->setFont(QFont(QLatin1String("monospace"))); + + QFont fixedPitchFont = font; + fixedPitchFont.setFixedPitch(true); + frameLabel->setFont(fixedPitchFont); connect(frameLabel, SIGNAL(linkActivated(QString)), SLOT(openLinkInEditor(QString))); // pad frameNr to 2 chars since only 50 frames max are supported by valgrind const QString displayText = displayTextTemplate |