Tool: add permanent config method

This commit is contained in:
lupoDharkael
2018-05-17 20:18:52 +02:00
parent 13b0e61d36
commit c81ee94a82
7 changed files with 11 additions and 35 deletions

View File

@@ -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);
}

View File

@@ -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;

View File

@@ -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;

View File

@@ -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:

View File

@@ -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);

View File

@@ -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:

View File

@@ -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;