diff options
author | hjk <hjk121@nokiamail.com> | 2014-09-30 13:08:05 +0200 |
---|---|---|
committer | hjk <hjk121@nokiamail.com> | 2014-09-30 15:46:34 +0200 |
commit | beef4807837101aa710ffba556c8fe362f92e026 (patch) | |
tree | 0eb5683aa6e44a63794e2c80f028dee96c2fd663 /src/plugins/texteditor/texteditor.h | |
parent | b1cc98f79beaca3aff62ebecbeb227c18cc2b896 (diff) | |
download | qt-creator-beef4807837101aa710ffba556c8fe362f92e026.tar.gz |
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>
Diffstat (limited to 'src/plugins/texteditor/texteditor.h')
-rw-r--r-- | src/plugins/texteditor/texteditor.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/plugins/texteditor/texteditor.h b/src/plugins/texteditor/texteditor.h index 2351ac6711..0622129bf8 100644 --- a/src/plugins/texteditor/texteditor.h +++ b/src/plugins/texteditor/texteditor.h @@ -61,6 +61,7 @@ namespace Core { class MimeType; } namespace TextEditor { +class BaseHoverHandler; class TabSettings; class RefactorOverlay; struct RefactorMarker; @@ -160,6 +161,7 @@ public: QWidget *toolBar(); QString contextHelpId() const; // from IContext + void setContextHelpId(const QString &id); int currentLine() const; int currentColumn() const; @@ -196,9 +198,7 @@ public: signals: void markRequested(TextEditor::BaseTextEditor *editor, int line, TextEditor::BaseTextEditor::MarkRequestKind kind); void markContextMenuRequested(TextEditor::BaseTextEditor *editor, int line, QMenu *menu); - void tooltipRequested(TextEditor::BaseTextEditor *editor, const QPoint &globalPos, int position); void markTooltipRequested(TextEditor::BaseTextEditor *editor, const QPoint &globalPos, int line); - void contextHelpIdRequested(TextEditor::BaseTextEditor *editor, int position); private: friend class TextEditorFactory; @@ -569,6 +569,9 @@ public: QChar characterAt(int pos) const; QString textAt(int from, int to) const; + QString contextHelpId(); + void setContextHelpId(const QString &id); + protected: /*! Reimplement this function to enable code navigation. @@ -603,7 +606,6 @@ signals: void tooltipRequested(const QPoint &globalPos, int position); void markTooltipRequested(const QPoint &globalPos, int line); void activateEditor(); - void clearContentsHelpId(); protected slots: virtual void slotCursorPositionChanged(); // Used in VcsBase @@ -626,6 +628,7 @@ class TEXTEDITOR_EXPORT TextEditorFactory : public Core::IEditorFactory public: TextEditorFactory(QObject *parent = 0); + ~TextEditorFactory(); typedef std::function<BaseTextEditor *()> EditorCreator; typedef std::function<TextDocument *()> DocumentCreator; @@ -645,6 +648,8 @@ public: void setEditorActionHandlers(Core::Id contextId, uint optionalActions); void setEditorActionHandlers(uint optionalActions); + void addHoverHandler(BaseHoverHandler *handler); + void setCommentStyle(Utils::CommentDefinition::Style style); void setDuplicatedSupported(bool on); @@ -664,6 +669,7 @@ private: IndenterCreator m_indenterCreator; SyntaxHighLighterCreator m_syntaxHighlighterCreator; Utils::CommentDefinition::Style m_commentStyle; + QList<BaseHoverHandler *> m_hoverHandlers; // owned bool m_duplicatedSupported; }; |