From c81ee94a825e69a825cb9e2f19469c2c1c4019c9 Mon Sep 17 00:00:00 2001 From: lupoDharkael Date: Thu, 17 May 2018 20:18:52 +0200 Subject: [PATCH] Tool: add permanent config method --- src/tools/abstractactiontool.cpp | 8 -------- src/tools/abstractactiontool.h | 3 --- src/tools/abstractpathtool.cpp | 8 -------- src/tools/abstractpathtool.h | 3 --- src/tools/abstracttwopointtool.cpp | 8 -------- src/tools/abstracttwopointtool.h | 3 --- src/tools/capturetool.h | 13 +++++++++++-- 7 files changed, 11 insertions(+), 35 deletions(-) diff --git a/src/tools/abstractactiontool.cpp b/src/tools/abstractactiontool.cpp index 7b9d28b7..e7d294b0 100644 --- a/src/tools/abstractactiontool.cpp +++ b/src/tools/abstractactiontool.cpp @@ -33,14 +33,6 @@ bool AbstractActionTool::showMousePreview() const { return false; } -QWidget *AbstractActionTool::widget() { - return nullptr; -} - -QWidget *AbstractActionTool::configurationWidget() { - return nullptr; -} - void AbstractActionTool::undo(QPixmap &pixmap) { Q_UNUSED(pixmap); } diff --git a/src/tools/abstractactiontool.h b/src/tools/abstractactiontool.h index 788d4c4b..e8c2f55f 100644 --- a/src/tools/abstractactiontool.h +++ b/src/tools/abstractactiontool.h @@ -28,9 +28,6 @@ public: bool isSelectable() const override; bool showMousePreview() const override; - QWidget* widget() override; - QWidget* configurationWidget() override; - void undo(QPixmap &pixmap) override; void process(QPainter &painter, const QPixmap &pixmap, bool recordUndo = false) override; void paintMousePreview(QPainter &painter, const CaptureContext &context) override; diff --git a/src/tools/abstractpathtool.cpp b/src/tools/abstractpathtool.cpp index 8df38ef9..204b5849 100644 --- a/src/tools/abstractpathtool.cpp +++ b/src/tools/abstractpathtool.cpp @@ -39,14 +39,6 @@ bool AbstractPathTool::showMousePreview() const { return true; } -QWidget *AbstractPathTool::widget() { - return nullptr; -} - -QWidget *AbstractPathTool::configurationWidget() { - return nullptr; -} - void AbstractPathTool::undo(QPixmap &pixmap) { QPainter p(&pixmap); const int val = m_thickness + m_padding; diff --git a/src/tools/abstractpathtool.h b/src/tools/abstractpathtool.h index aef05ce4..4c329cf9 100644 --- a/src/tools/abstractpathtool.h +++ b/src/tools/abstractpathtool.h @@ -29,9 +29,6 @@ public: bool isSelectable() const override; bool showMousePreview() const override; - QWidget* widget() override; - QWidget* configurationWidget() override; - void undo(QPixmap &pixmap) override; public slots: diff --git a/src/tools/abstracttwopointtool.cpp b/src/tools/abstracttwopointtool.cpp index 1a3cc5fb..db077ad3 100644 --- a/src/tools/abstracttwopointtool.cpp +++ b/src/tools/abstracttwopointtool.cpp @@ -39,14 +39,6 @@ bool AbstractTwoPointTool::showMousePreview() const { return true; } -QWidget *AbstractTwoPointTool::widget() { - return nullptr; -} - -QWidget *AbstractTwoPointTool::configurationWidget() { - return nullptr; -} - void AbstractTwoPointTool::undo(QPixmap &pixmap) { QPainter p(&pixmap); p.drawPixmap(backupRect(pixmap.rect()).topLeft(), m_pixmapBackup); diff --git a/src/tools/abstracttwopointtool.h b/src/tools/abstracttwopointtool.h index 25416e2a..d2db8cb0 100644 --- a/src/tools/abstracttwopointtool.h +++ b/src/tools/abstracttwopointtool.h @@ -29,9 +29,6 @@ public: bool isSelectable() const override; bool showMousePreview() const override; - QWidget* widget() override; - QWidget* configurationWidget() override; - void undo(QPixmap &pixmap) override; public slots: diff --git a/src/tools/capturetool.h b/src/tools/capturetool.h index 1c352515..25f8f4c4 100644 --- a/src/tools/capturetool.h +++ b/src/tools/capturetool.h @@ -93,10 +93,19 @@ public: // if the type is TYPE_WIDGET the widget is loaded in the main widget. // If the type is TYPE_EXTERNAL_WIDGET it is created outside as an // individual widget. - virtual QWidget* widget() = 0; + virtual QWidget* widget() { + return nullptr; + } // When the tool is selected this method is called and the widget is added // to the configuration panel inside the main widget. - virtual QWidget* configurationWidget() = 0; + virtual QWidget* configurationWidget() { + return nullptr; + } + // Permanent configuration used in the configuration outside of the + // capture. + virtual QWidget* permanentConfigurationWidget() { + return nullptr; + } // Return a copy of the tool virtual CaptureTool* copy(QObject *parent = nullptr) = 0;