forked from qt-creator/qt-creator
Core: Return context help id by callback
...to support asynchronous providers. Change-Id: I483489c74e7886d5bc2bf00b65540c3d2c7afee0 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -7913,9 +7913,9 @@ void TextEditorWidgetPrivate::updateCursorPosition()
|
||||
q->ensureCursorVisible();
|
||||
}
|
||||
|
||||
QString BaseTextEditor::contextHelpId() const
|
||||
void BaseTextEditor::contextHelpId(const HelpIdCallback &callback) const
|
||||
{
|
||||
return editorWidget()->contextHelpId();
|
||||
editorWidget()->contextHelpId(callback);
|
||||
}
|
||||
|
||||
void BaseTextEditor::setContextHelpId(const QString &id)
|
||||
@@ -7924,11 +7924,11 @@ void BaseTextEditor::setContextHelpId(const QString &id)
|
||||
editorWidget()->setContextHelpId(id);
|
||||
}
|
||||
|
||||
QString TextEditorWidget::contextHelpId()
|
||||
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());
|
||||
return d->m_contextHelpId;
|
||||
callback(d->m_contextHelpId);
|
||||
}
|
||||
|
||||
void TextEditorWidget::setContextHelpId(const QString &id)
|
||||
|
||||
Reference in New Issue
Block a user