aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/texteditor/basehoverhandler.cpp
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@theqtcompany.com>2015-08-07 17:21:38 +0200
committerEike Ziller <eike.ziller@theqtcompany.com>2015-09-30 08:25:18 +0000
commit6ed775f56a17a6fc3bb48323bd43373d8589b7b0 (patch)
treeb571442b4a954a56d3b9e5f9964196f064cf239e /src/plugins/texteditor/basehoverhandler.cpp
parent6781e3c96b987024a0a4a7b4cdef213668adc286 (diff)
Fix wrong context help if tool tip was not shown for focus widget
The tool tip never has focus, so it cannot become the IContext that is checked for context help. So, integrate the help id into Utils::ToolTip and check the tool tip first when checking for context help. As a side effect the [F1] button and help id for the tool tip is now also available for use outside of the text editors. Task-number: QTCREATORBUG-5345 Change-Id: Id975703caf161d1183c247e8ad8bb693b90fd306 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com> Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
Diffstat (limited to 'src/plugins/texteditor/basehoverhandler.cpp')
-rw-r--r--src/plugins/texteditor/basehoverhandler.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/plugins/texteditor/basehoverhandler.cpp b/src/plugins/texteditor/basehoverhandler.cpp
index 08e1bbcdb3..b76250a422 100644
--- a/src/plugins/texteditor/basehoverhandler.cpp
+++ b/src/plugins/texteditor/basehoverhandler.cpp
@@ -82,13 +82,6 @@ void BaseHoverHandler::appendToolTip(const QString &extension)
m_toolTip.append(extension);
}
-void BaseHoverHandler::addF1ToToolTip()
-{
- m_toolTip = QString::fromLatin1("<table><tr><td valign=middle>%1</td><td>&nbsp;&nbsp;"
- "<img src=\":/texteditor/images/f1.png\"></td>"
- "</tr></table>").arg(m_toolTip);
-}
-
void BaseHoverHandler::setIsDiagnosticTooltip(bool isDiagnosticTooltip)
{
m_diagnosticTooltip = isDiagnosticTooltip;
@@ -133,7 +126,6 @@ void BaseHoverHandler::decorateToolTip()
if (!contents.isEmpty()) {
setToolTip(toolTip().toHtmlEscaped());
appendToolTip(contents);
- addF1ToToolTip();
}
}
}
@@ -143,7 +135,9 @@ void BaseHoverHandler::operateTooltip(TextEditorWidget *editorWidget, const QPoi
if (m_toolTip.isEmpty())
Utils::ToolTip::hide();
else
- Utils::ToolTip::show(point, m_toolTip, editorWidget);
+ Utils::ToolTip::show(point, m_toolTip, editorWidget, m_lastHelpItemIdentified.isValid()
+ ? m_lastHelpItemIdentified.helpId()
+ : QString());
}
} // namespace TextEditor