Better flexibility and extensibility in text editor tooltip's internals.

This commit is contained in:
Leandro Melo
2010-08-23 15:21:02 +02:00
parent 42d15fcf74
commit 14ffff317c
13 changed files with 548 additions and 150 deletions

View File

@@ -41,6 +41,7 @@
#include <texteditor/itexteditor.h>
#include <texteditor/basetexteditor.h>
#include <texteditor/tooltip/tooltip.h>
#include <texteditor/tooltip/tipcontents.h>
using namespace Core;
using namespace QmlJS;
@@ -235,12 +236,16 @@ void HoverHandler::operateTooltip(TextEditor::ITextEditor *editor, const QPoint
TextEditor::ToolTip::instance()->hide();
else {
if (m_colorTip.isValid()) {
TextEditor::ToolTip::instance()->showColor(point, m_colorTip, editor->widget());
TextEditor::ToolTip::instance()->show(point,
TextEditor::ColorContent(m_colorTip),
editor->widget());
} else {
if (matchingHelpCandidate() != -1)
addF1ToToolTip();
TextEditor::ToolTip::instance()->showText(point, toolTip(), editor->widget());
TextEditor::ToolTip::instance()->show(point,
TextEditor::TextContent(toolTip()),
editor->widget());
}
}
}