From 87f830302347e9773404f51de73afc7041829374 Mon Sep 17 00:00:00 2001 From: Fabio D'Urso Date: Thu, 1 Aug 2013 14:17:26 +0200 Subject: [PATCH] dolphin: Escape text in statusbar tooltip This fixes the same issue as 4450f8449af91e491636728a4669e2a9e27b49fa, but for the status bar's tooltip text. BUG: 323170 FIXED-IN: 4.11.0 REVIEW: 111836 --- src/statusbar/dolphinstatusbar.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/statusbar/dolphinstatusbar.cpp b/src/statusbar/dolphinstatusbar.cpp index 1489191720..bff9566420 100644 --- a/src/statusbar/dolphinstatusbar.cpp +++ b/src/statusbar/dolphinstatusbar.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -324,10 +325,17 @@ void DolphinStatusBar::updateLabelText() { const QString text = m_text.isEmpty() ? m_defaultText : m_text; + // Set status bar text and elide it if too long QFontMetrics fontMetrics(m_label->font()); const QString elidedText = fontMetrics.elidedText(text, Qt::ElideRight, m_label->width()); m_label->setText(elidedText); - m_label->setToolTip(text == elidedText ? QString() : text); + + // If the text has been elided, set the original text as tooltip + if (text != elidedText) { + m_label->setToolTip(Qt::convertFromPlainText(text)); + } else { + m_label->setToolTip(QString()); + } } void DolphinStatusBar::slotResetToDefaultText()