diff options
author | Nikolai Kosjar <nikolai.kosjar@qt.io> | 2018-01-18 10:47:45 +0100 |
---|---|---|
committer | Nikolai Kosjar <nikolai.kosjar@qt.io> | 2018-01-19 13:57:57 +0000 |
commit | 0a4073ef90cb61400856ead7c137064096694b6a (patch) | |
tree | db37a4246ce5365b9c7d04f9b5474728585b3064 /src/plugins/texteditor/colorpreviewhoverhandler.cpp | |
parent | 2d7f1d6c8cf5c9be01d12bd71dbf05da6ce7c3d6 (diff) |
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>
Diffstat (limited to 'src/plugins/texteditor/colorpreviewhoverhandler.cpp')
-rw-r--r-- | src/plugins/texteditor/colorpreviewhoverhandler.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/plugins/texteditor/colorpreviewhoverhandler.cpp b/src/plugins/texteditor/colorpreviewhoverhandler.cpp index c6ca5947d0..6a6f4e20dd 100644 --- a/src/plugins/texteditor/colorpreviewhoverhandler.cpp +++ b/src/plugins/texteditor/colorpreviewhoverhandler.cpp @@ -27,6 +27,7 @@ #include "texteditor.h" #include <coreplugin/icore.h> +#include <utils/executeondestruction.h> #include <utils/tooltip/tooltip.h> #include <utils/qtcassert.h> @@ -355,8 +356,12 @@ static QColor colorFromFuncAndArgs(const QString &func, const QStringList &args) return colorFromArgs(args, spec); } -void ColorPreviewHoverHandler::identifyMatch(TextEditorWidget *editorWidget, int pos) +void ColorPreviewHoverHandler::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(); |