Tool: add permanent config method
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user