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;
57class GUI_EXPORT QgsModelDesignerDialog :
public QMainWindow,
public Ui::QgsModelDesignerDialogBase
62 QgsModelDesignerDialog( QWidget *parent
SIP_TRANSFERTHIS =
nullptr, Qt::WindowFlags flags = Qt::WindowFlags() );
63 ~QgsModelDesignerDialog()
override;
65 void closeEvent( QCloseEvent *event )
override;
70 void beginUndoCommand(
const QString &text,
int id = 0 );
75 void endUndoCommand();
80 QgsProcessingModelAlgorithm *model();
87 void setModel( QgsProcessingModelAlgorithm *model
SIP_TRANSFER );
92 void loadModel(
const QString &path );
97 void setModelScene( QgsModelGraphicsScene *scene
SIP_TRANSFER );
104 enum class SaveAction
122 virtual void repaintModel(
bool showControls =
true ) = 0;
123 virtual void addAlgorithm(
const QString &algorithmId,
const QPointF &pos ) = 0;
125 virtual void addInput(
const QString &inputId,
const QPointF &pos ) = 0;
127 virtual void exportAsScriptAlgorithm() = 0;
129 virtual bool saveModel(
bool saveAs =
false ) = 0;
131 virtual QgsProcessingAlgorithmDialogBase *createExecutionDialog() = 0
SIP_TRANSFERBACK;
133 QToolBar *toolbar() {
return mToolbar; }
134 QAction *actionOpen() {
return mActionOpen; }
135 QAction *actionSaveInProject() {
return mActionSaveInProject; }
136 QAction *actionRun() {
return mActionRun; }
138 QGraphicsView *view() {
return mView; }
140 void setDirty(
bool dirty );
145 bool validateSave( SaveAction action );
152 bool checkForUnsavedChanges();
166 void setModelName(
const QString &name );
174 void exportToImage();
177 void exportAsPython();
178 void toggleComments(
bool show );
179 void updateWindowTitle();
180 void deleteSelected();
181 void populateZoomToMenu();
183 void reorderInputs();
184 void reorderOutputs();
185 void setPanelVisibility(
bool hidden );
187 void runSelectedSteps();
188 void runFromChild(
const QString &
id );
189 void run(
const QSet<QString> &childAlgorithmSubset = QSet<QString>() );
190 void showChildAlgorithmOutputs(
const QString &childId );
191 void showChildAlgorithmLog(
const QString &childId );
201 std::unique_ptr< QgsProcessingModelAlgorithm > mModel;
206 QgsModelerToolboxModel *mAlgorithmsModel =
nullptr;
208 QActionGroup *mToolsActionGroup =
nullptr;
212 QgsModelGraphicsScene *mScene =
nullptr;
214 bool mHasChanged =
false;
215 QUndoStack *mUndoStack =
nullptr;
216 std::unique_ptr< QgsModelUndoCommand > mActiveCommand;
218 QAction *mUndoAction =
nullptr;
219 QAction *mRedoAction =
nullptr;
220 QUndoView *mUndoView =
nullptr;
223 QMenu *mGroupMenu =
nullptr;
225 QAction *mActionCut =
nullptr;
226 QAction *mActionCopy =
nullptr;
227 QAction *mActionPaste =
nullptr;
228 int mBlockUndoCommands = 0;
229 int mIgnoreUndoStackChanges = 0;
233 int mBlockRepaints = 0;
237 bool isDirty()
const;
239 void fillInputsTree();
240 void updateVariablesGui();
244 PanelStatus(
bool visible =
true,
bool active =
false )
245 : isVisible( visible )
251 QMap< QString, PanelStatus > mPanelStatus;
258class GUI_EXPORT QgsModelChildDependenciesWidget :
public QWidget
264 QgsModelChildDependenciesWidget( QWidget *parent, QgsProcessingModelAlgorithm *model,
const QString &childId );
265 QList< QgsProcessingModelChildDependency > value()
const {
return mValue; }
266 void setValue(
const QList< QgsProcessingModelChildDependency > &value );
273 void updateSummaryText();
275 QLineEdit *mLineEdit =
nullptr;
276 QToolButton *mToolButton =
nullptr;
278 QgsProcessingModelAlgorithm *mModel =
nullptr;
281 QList< QgsProcessingModelChildDependency > mValue;
283 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.