From 17b409b2e6c7d0585a8a5008bb8b522f7cf768b0 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 23 Jan 2014 12:31:54 +0100 Subject: [PATCH] qt: Fix richtext detection hang issue on very old Qt versions Alternative implementation. Thanks to @awoland for the original. Fixes #3486. --- src/qt/guiutil.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index 2d8a6afe21889..a69ea28fdf201 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -361,11 +361,11 @@ bool ToolTipToRichTextFilter::eventFilter(QObject *obj, QEvent *evt) { QWidget *widget = static_cast(obj); QString tooltip = widget->toolTip(); - if(tooltip.size() > size_threshold && !tooltip.startsWith("") && !Qt::mightBeRichText(tooltip)) + if(tooltip.size() > size_threshold && !tooltip.startsWith(" to make sure Qt detects this as rich text + // Envelop with to make sure Qt detects this as rich text // Escape the current message as HTML and replace \n by
- tooltip = "" + HtmlEscape(tooltip, true); + tooltip = "" + HtmlEscape(tooltip, true) + ""; widget->setToolTip(tooltip); return true; }