Skip to content

Commit 17b409b

Browse files
committed
qt: Fix richtext detection hang issue on very old Qt versions
Alternative implementation. Thanks to @awoland for the original. Fixes #3486.
1 parent 8b2cf12 commit 17b409b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/qt/guiutil.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -361,11 +361,11 @@ bool ToolTipToRichTextFilter::eventFilter(QObject *obj, QEvent *evt)
361361
{
362362
QWidget *widget = static_cast<QWidget*>(obj);
363363
QString tooltip = widget->toolTip();
364-
if(tooltip.size() > size_threshold && !tooltip.startsWith("<qt/>") && !Qt::mightBeRichText(tooltip))
364+
if(tooltip.size() > size_threshold && !tooltip.startsWith("<qt") && !Qt::mightBeRichText(tooltip))
365365
{
366-
// Prefix <qt/> to make sure Qt detects this as rich text
366+
// Envelop with <qt></qt> to make sure Qt detects this as rich text
367367
// Escape the current message as HTML and replace \n by <br>
368-
tooltip = "<qt/>" + HtmlEscape(tooltip, true);
368+
tooltip = "<qt>" + HtmlEscape(tooltip, true) + "</qt>";
369369
widget->setToolTip(tooltip);
370370
return true;
371371
}

0 commit comments

Comments
 (0)