Help: Make a difference between "empty" and "valid"

Context help should take the HelpItem from the tool tip if it was set,
even if it isn't valid.
Similarly, if the help item was set on the text editor, it should not
ask the hover handlers (again), even if that is invalid

Change-Id: I481f8ad73c3cf8fdbb90f737ab36b4e380467026
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Eike Ziller
2019-02-01 12:11:57 +01:00
parent d07e5b2a46
commit 92ddaea43e
4 changed files with 8 additions and 2 deletions

View File

@@ -8008,7 +8008,7 @@ void BaseTextEditor::setContextHelp(const HelpItem &item)
void TextEditorWidget::contextHelpItem(const IContext::HelpCallback &callback)
{
if (!d->m_contextHelpItem.isValid() && !d->m_hoverHandlers.isEmpty()) {
if (d->m_contextHelpItem.isEmpty() && !d->m_hoverHandlers.isEmpty()) {
d->m_hoverHandlers.first()->contextHelpId(this,
Text::wordStartCursor(textCursor()).position(),
callback);