diff options
Diffstat (limited to 'src/plugins/texteditor/basehoverhandler.cpp')
-rw-r--r-- | src/plugins/texteditor/basehoverhandler.cpp | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/plugins/texteditor/basehoverhandler.cpp b/src/plugins/texteditor/basehoverhandler.cpp index ceaa26f55f..89694bfc8f 100644 --- a/src/plugins/texteditor/basehoverhandler.cpp +++ b/src/plugins/texteditor/basehoverhandler.cpp @@ -142,25 +142,18 @@ void BaseHoverHandler::process(ITextEditor *editor, int pos) { clear(); identifyMatch(editor, pos); - decorateToolTip(editor); + decorateToolTip(); } -void BaseHoverHandler::decorateToolTip(ITextEditor *editor) +void BaseHoverHandler::decorateToolTip() { - BaseTextEditor *baseEditor = baseTextEditor(editor); - if (!baseEditor) - return; + if (Qt::mightBeRichText(toolTip())) + setToolTip(Qt::escape(toolTip())); if (lastHelpItemIdentified().isValid()) { const QString &contents = lastHelpItemIdentified().extractContent(false); - if (!contents.isEmpty()) { + if (!contents.isEmpty()) appendToolTip(contents); - } else { - QString tip = Qt::escape(toolTip()); - tip.prepend(QLatin1String("<nobr>")); - tip.append(QLatin1String("</nobr>")); - setToolTip(tip); - } addF1ToToolTip(); } } |