forked from qt-creator/qt-creator
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:
@@ -33,6 +33,7 @@
|
||||
#include <projectexplorer/projecttree.h>
|
||||
#include <projectexplorer/project.h>
|
||||
#include <texteditor/texteditor.h>
|
||||
#include <utils/executeondestruction.h>
|
||||
|
||||
#include <QPoint>
|
||||
#include <QTextBlock>
|
||||
@@ -164,8 +165,12 @@ static QString findResourceInProject(const QString &resName)
|
||||
return QString();
|
||||
}
|
||||
|
||||
void ResourcePreviewHoverHandler::identifyMatch(TextEditorWidget *editorWidget, int pos)
|
||||
void ResourcePreviewHoverHandler::identifyMatch(TextEditorWidget *editorWidget,
|
||||
int pos,
|
||||
ReportPriority report)
|
||||
{
|
||||
Utils::ExecuteOnDestruction reportPriority([this, report](){ report(priority()); });
|
||||
|
||||
if (editorWidget->extraSelectionTooltip(pos).isEmpty()) {
|
||||
const QTextBlock tb = editorWidget->document()->findBlock(pos);
|
||||
const int tbpos = pos - tb.position();
|
||||
|
||||
Reference in New Issue
Block a user