aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/texteditor/texteditoractionhandler.h
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2017-05-08 13:52:34 +0200
committerEike Ziller <eike.ziller@qt.io>2017-05-18 08:24:20 +0000
commitfd7edcb8263059d828873e5ed675fa2e43dfdf01 (patch)
tree7e7a3e7ff5bfb0b80f417155a4e09014d71ae77c /src/plugins/texteditor/texteditoractionhandler.h
parent2684254fadad83dd25ae5e62141c8fc11a638543 (diff)
TextEditorActionHandler: Use configuration instead of inheritance
Avoids creating subclasses just for implementing a single method. Change-Id: I813a0a20eaba8fefa004b74f92d48a9a9c4bfcc1 Reviewed-by: David Schulz <david.schulz@qt.io>
Diffstat (limited to 'src/plugins/texteditor/texteditoractionhandler.h')
-rw-r--r--src/plugins/texteditor/texteditoractionhandler.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/texteditor/texteditoractionhandler.h b/src/plugins/texteditor/texteditoractionhandler.h
index 0b99c3b9b7..77d06c86b0 100644
--- a/src/plugins/texteditor/texteditoractionhandler.h
+++ b/src/plugins/texteditor/texteditoractionhandler.h
@@ -29,6 +29,8 @@
#include <QObject>
+#include <functional>
+
namespace Core {
class Id;
class IEditor;
@@ -54,13 +56,13 @@ public:
FollowSymbolUnderCursor = 8,
JumpToFileUnderCursor = 16
};
+ using TextEditorWidgetResolver = std::function<TextEditorWidget *(Core::IEditor *)>;
explicit TextEditorActionHandler(QObject *parent, Core::Id editorId, Core::Id contextId,
uint optionalActions = None);
~TextEditorActionHandler();
-protected:
- virtual TextEditorWidget *resolveTextEditorWidget(Core::IEditor *editor) const;
+ void setTextEditorWidgetResolver(const TextEditorWidgetResolver &resolver);
private:
friend class Internal::TextEditorActionHandlerPrivate;