16#ifndef QGSMODELDESIGNERDIALOG_H
17#define QGSMODELDESIGNERDIALOG_H
21#include "ui_qgsmodeldesignerdialogbase.h"
27class QgsProcessingModelAlgorithm;
28class QgsModelUndoCommand;
33class QgsProcessingAlgorithmDialogBase;
43 explicit QgsModelerToolboxModel( QObject *parent =
nullptr );
44 Qt::ItemFlags flags(
const QModelIndex &index )
const override;
45 Qt::DropActions supportedDragActions()
const override;
56class GUI_EXPORT QgsModelDesignerDialog :
public QMainWindow,
public Ui::QgsModelDesignerDialogBase
60 QgsModelDesignerDialog( QWidget *parent
SIP_TRANSFERTHIS =
nullptr, Qt::WindowFlags flags = Qt::WindowFlags() );
61 ~QgsModelDesignerDialog()
override;
63 void closeEvent( QCloseEvent *event )
override;
68 void beginUndoCommand(
const QString &text,
int id = 0 );
73 void endUndoCommand();
78 QgsProcessingModelAlgorithm *model();
85 void setModel( QgsProcessingModelAlgorithm *model
SIP_TRANSFER );
90 void loadModel(
const QString &path );
95 void setModelScene( QgsModelGraphicsScene *scene
SIP_TRANSFER );
102 enum class SaveAction
119 virtual void repaintModel(
bool showControls =
true ) = 0;
120 virtual void addAlgorithm(
const QString &algorithmId,
const QPointF &pos ) = 0;
122 virtual void addInput(
const QString &inputId,
const QPointF &pos ) = 0;
124 virtual void exportAsScriptAlgorithm() = 0;
126 virtual bool saveModel(
bool saveAs =
false ) = 0;
128 virtual QgsProcessingAlgorithmDialogBase *createExecutionDialog() = 0
SIP_TRANSFERBACK;
130 QToolBar *toolbar() {
return mToolbar; }
131 QAction *actionOpen() {
return mActionOpen; }
132 QAction *actionSaveInProject() {
return mActionSaveInProject; }
133 QAction *actionRun() {
return mActionRun; }
135 QGraphicsView *view() {
return mView; }
137 void setDirty(
bool dirty );
142 bool validateSave( SaveAction action );
149 bool checkForUnsavedChanges();
163 void setModelName(
const QString &name );
171 void exportToImage();
174 void exportAsPython();
175 void toggleComments(
bool show );
176 void updateWindowTitle();
177 void deleteSelected();
178 void populateZoomToMenu();
180 void reorderInputs();
181 void reorderOutputs();
182 void setPanelVisibility(
bool hidden );
184 void runSelectedSteps();
185 void runFromChild(
const QString &
id );
186 void run(
const QSet<QString> &childAlgorithmSubset = QSet<QString>() );
187 void showChildAlgorithmOutputs(
const QString &childId );
188 void showChildAlgorithmLog(
const QString &childId );
197 std::unique_ptr<QgsProcessingModelAlgorithm> mModel;
202 QgsModelerToolboxModel *mAlgorithmsModel =
nullptr;
204 QActionGroup *mToolsActionGroup =
nullptr;
208 QgsModelGraphicsScene *mScene =
nullptr;
210 bool mHasChanged =
false;
211 QUndoStack *mUndoStack =
nullptr;
212 std::unique_ptr<QgsModelUndoCommand> mActiveCommand;
214 QAction *mUndoAction =
nullptr;
215 QAction *mRedoAction =
nullptr;
216 QUndoView *mUndoView =
nullptr;
219 QMenu *mGroupMenu =
nullptr;
221 QAction *mActionCut =
nullptr;
222 QAction *mActionCopy =
nullptr;
223 QAction *mActionPaste =
nullptr;
224 int mBlockUndoCommands = 0;
225 int mIgnoreUndoStackChanges = 0;
229 int mBlockRepaints = 0;
233 bool isDirty()
const;
235 void fillInputsTree();
236 void updateVariablesGui();
240 PanelStatus(
bool visible =
true,
bool active =
false )
241 : isVisible( visible )
247 QMap<QString, PanelStatus> mPanelStatus;
253class GUI_EXPORT QgsModelChildDependenciesWidget :
public QWidget
258 QgsModelChildDependenciesWidget( QWidget *parent, QgsProcessingModelAlgorithm *model,
const QString &childId );
259 QList<QgsProcessingModelChildDependency> value()
const {
return mValue; }
260 void setValue(
const QList<QgsProcessingModelChildDependency> &value );
266 void updateSummaryText();
268 QLineEdit *mLineEdit =
nullptr;
269 QToolButton *mToolButton =
nullptr;
271 QgsProcessingModelAlgorithm *mModel =
nullptr;
274 QList<QgsProcessingModelChildDependency> mValue;
276 friend class TestProcessingGui;
A bar for displaying non-blocking messages to the user.
Contains information about the context in which a processing algorithm is executed.
Encapsulates the results of running a Processing model.
A utility class for dynamic handling of changes to screen properties.