TextEditor: Return hover handler priority by callback

...to get rid of the asynchronous code path.

Change-Id: I56377510440631b0be712333b2a4018717c86389
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Nikolai Kosjar
2018-01-18 10:47:45 +01:00
parent 2d7f1d6c8c
commit 0a4073ef90
17 changed files with 69 additions and 60 deletions

View File

@@ -31,6 +31,7 @@
#include <texteditor/texteditor.h>
#include <utils/textutils.h>
#include <utils/executeondestruction.h>
#include <QTextCursor>
#include <QUrl>
@@ -67,8 +68,10 @@ QString CppHoverHandler::tooltipTextForHelpItem(const HelpItem &helpItem)
return QString();
}
void CppHoverHandler::identifyMatch(TextEditorWidget *editorWidget, int pos)
void CppHoverHandler::identifyMatch(TextEditorWidget *editorWidget, int pos, ReportPriority report)
{
Utils::ExecuteOnDestruction reportPriority([this, report](){ report(priority()); });
QTextCursor tc(editorWidget->document());
tc.setPosition(pos);