TextEditor: Let BaseHoverHandler handle help id callbacks

...to support asynchronous hover handlers like ClangHoverHandler.

Change-Id: I8dc7189db37ec3a923cf493b8957c59ec9be447c
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Nikolai Kosjar
2018-01-18 11:58:22 +01:00
parent 0a4073ef90
commit 9fd9bd25ab
3 changed files with 27 additions and 9 deletions

View File

@@ -7925,8 +7925,9 @@ void BaseTextEditor::setContextHelpId(const QString &id)
void TextEditorWidget::contextHelpId(const IContext::HelpIdCallback &callback)
{
if (d->m_contextHelpId.isEmpty() && !d->m_hoverHandlers.isEmpty())
d->m_contextHelpId = d->m_hoverHandlers.first()->contextHelpId(this, textCursor().position());
callback(d->m_contextHelpId);
d->m_hoverHandlers.first()->contextHelpId(this, textCursor().position(), callback);
else
callback(d->m_contextHelpId);
}
void TextEditorWidget::setContextHelpId(const QString &id)