TextEditor: Implement BaseHoverHandler::identifyMatch()

The extra selection tooltips are a good default for a hover match. We
use that in the basic plaintext editor to show, for example, syntax
errors in XML documents, detected during extra compiler runs.

Change-Id: Ib7f755c482ebc04148567105e4779324799fb670
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
This commit is contained in:
Ulf Hermann
2016-01-22 11:48:22 +01:00
parent 654aa3a0d7
commit 0dff03e6fe
3 changed files with 10 additions and 1 deletions

View File

@@ -143,6 +143,13 @@ void BaseHoverHandler::process(TextEditorWidget *widget, int pos)
decorateToolTip();
}
void BaseHoverHandler::identifyMatch(TextEditorWidget *editorWidget, int pos)
{
QString tooltip = editorWidget->extraSelectionTooltip(pos);
if (!tooltip.isEmpty())
setToolTip(tooltip);
}
void BaseHoverHandler::decorateToolTip()
{
if (Qt::mightBeRichText(toolTip()))