aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/texteditor/basehoverhandler.cpp
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2018-01-25 15:51:36 +0100
committerEike Ziller <eike.ziller@qt.io>2019-01-21 10:30:03 +0000
commit6c10d36f8776900f75f16ae26a127e4771eda1e6 (patch)
treee2932ae96fd5a2ca0e3d84a5ef818bf16704fb36 /src/plugins/texteditor/basehoverhandler.cpp
parent2d8bc0e509a5dbb7314ea12eeb7a28acc13d82cd (diff)
Try harder to get context help in presence of diagnostics
- even if there are diagnostics still try to retrieve symbol info and help - fall back to text based keyword extraction in case code model info fails - if both a code model tool tip (e.g. function signature or type) and help are available, show both Task-number: QTCREATORBUG-15959 Change-Id: Id85a223c24849ead1b25d63776d64a7da1cc73ef Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Diffstat (limited to 'src/plugins/texteditor/basehoverhandler.cpp')
-rw-r--r--src/plugins/texteditor/basehoverhandler.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/texteditor/basehoverhandler.cpp b/src/plugins/texteditor/basehoverhandler.cpp
index 157397ef2f8..7eb5bc70b6a 100644
--- a/src/plugins/texteditor/basehoverhandler.cpp
+++ b/src/plugins/texteditor/basehoverhandler.cpp
@@ -148,11 +148,11 @@ void BaseHoverHandler::decorateToolTip()
if (Qt::mightBeRichText(toolTip()))
setToolTip(toolTip().toHtmlEscaped());
- if (priority() != Priority_Diagnostic && lastHelpItemIdentified().isValid()) {
- const QString &contents = lastHelpItemIdentified().extractContent(false);
- if (!contents.isEmpty()) {
+ if (lastHelpItemIdentified().isValid()) {
+ const QString &helpContents = lastHelpItemIdentified().extractContent(false);
+ if (!helpContents.isEmpty()) {
m_toolTip = toolTip().toHtmlEscaped();
- m_toolTip.append(contents);
+ m_toolTip = m_toolTip.isEmpty() ? helpContents : ("<p>" + m_toolTip + "</p><hr/><p>" + helpContents + "</p>");
}
}
}