TextEditor: Simplify HoverHandler handling

The editor factories are already a central place to associate
hover handlers with editors, no need to retrieve them later from
the object pool again. This also allows for easy handling of
more than one active handler per editor.

Change-Id: Ie716b96f5ce6b526ee897468635e03e909d81538
Reviewed-by: David Schulz <david.schulz@digia.com>
This commit is contained in:
hjk
2014-09-30 13:08:05 +02:00
parent b1cc98f79b
commit beef480783
19 changed files with 83 additions and 123 deletions

View File

@@ -46,9 +46,12 @@ class TEXTEDITOR_EXPORT BaseHoverHandler : public QObject
Q_OBJECT
public:
BaseHoverHandler(QObject *parent = 0);
BaseHoverHandler();
~BaseHoverHandler();
QString contextHelpId(TextEditorWidget *widget, int pos);
void showToolTip(TextEditorWidget *widget, const QPoint &point, int pos);
protected:
void setToolTip(const QString &tooltip);
void appendToolTip(const QString &extension);
@@ -63,14 +66,9 @@ protected:
const HelpItem &lastHelpItemIdentified() const;
private:
void editorOpened(Core::IEditor *editor);
void showToolTip(BaseTextEditor *editor, const QPoint &point, int pos);
void updateContextHelpId(BaseTextEditor *editor, int pos);
void clear();
void process(BaseTextEditor *editor, int pos);
void process(TextEditorWidget *widget, int pos);
virtual bool acceptEditor(Core::IEditor *editor) = 0;
virtual void identifyMatch(TextEditorWidget *editorWidget, int pos) = 0;
virtual void decorateToolTip();
virtual void operateTooltip(TextEditorWidget *editorWidget, const QPoint &point);