forked from qt-creator/qt-creator
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user