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