forked from qt-creator/qt-creator
TextEditor: Add "F1" hint to tooltip if and only if help is available
Note that this does not have performance implications, as we already call HelpItem::isValid() in the same code path. Fixes: QTCREATORBUG-24782 Change-Id: I8495099c97233e4df4b8d2a30579fb6324122e92 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -143,9 +143,9 @@ void BaseHoverHandler::identifyMatch(TextEditorWidget *editorWidget, int pos, Re
|
|||||||
|
|
||||||
void BaseHoverHandler::operateTooltip(TextEditorWidget *editorWidget, const QPoint &point)
|
void BaseHoverHandler::operateTooltip(TextEditorWidget *editorWidget, const QPoint &point)
|
||||||
{
|
{
|
||||||
const QVariant helpItem = m_lastHelpItemIdentified.isEmpty()
|
const QVariant helpItem = m_lastHelpItemIdentified.isValid()
|
||||||
? QVariant()
|
? QVariant::fromValue(m_lastHelpItemIdentified)
|
||||||
: QVariant::fromValue(m_lastHelpItemIdentified);
|
: QVariant();
|
||||||
const bool extractHelp = m_lastHelpItemIdentified.isValid()
|
const bool extractHelp = m_lastHelpItemIdentified.isValid()
|
||||||
&& !m_lastHelpItemIdentified.isFuzzyMatch();
|
&& !m_lastHelpItemIdentified.isFuzzyMatch();
|
||||||
const QString helpContents = extractHelp ? m_lastHelpItemIdentified.firstParagraph()
|
const QString helpContents = extractHelp ? m_lastHelpItemIdentified.firstParagraph()
|
||||||
|
Reference in New Issue
Block a user