Class: QgsModelDesignerDialog¶
Model designer dialog base class
Warning
Not stable API
Added in version 3.14.
Class Hierarchy¶
Base classes¶
Enums
Save action. |
Methods
Raise, unminimize and activate this window. |
|
Starts an undo command. |
|
Checks if there are unsaved changes in the model, and if so, prompts the user to save them. |
|
Ends the current undo command. |
|
Loads a model into the designer from the specified file path. |
|
Returns the model shown in the dialog. |
|
Sets the result of the last run of the model through the designer window. |
|
Sets the model shown in the dialog. |
|
Sets the model name. |
|
Sets the related scene. |
|
Checks if the model can current be saved, and returns |
|
- class qgis.gui.QgsModelDesignerDialog[source]¶
Bases:
QMainWindow
- class SaveAction(*values)¶
Bases:
IntEnum
Save action.
Added in version 3.24.
SaveAsFile
: Save model as a fileSaveInProject
: Save model into project
- SaveAsFile = 0¶
- SaveInProject = 1¶
- addAlgorithm(self, algorithmId: str | None, pos: QPointF | QPoint)[source]¶
- Parameters:
algorithmId (Optional[str])
pos (Union[QPointF, QPoint])
- addInput(self, inputId: str | None, pos: QPointF | QPoint)[source]¶
- Parameters:
inputId (Optional[str])
pos (Union[QPointF, QPoint])
- beginUndoCommand(self, text: str | None, id: int = 0)[source]¶
Starts an undo command. This should be called before any changes are made to the model.
- Parameters:
text (Optional[str])
id (int = 0)
- checkForUnsavedChanges(self) bool [source]¶
Checks if there are unsaved changes in the model, and if so, prompts the user to save them.
Returns
False
if the cancel option was selected- Return type:
bool
- createExecutionDialog(self) QgsProcessingAlgorithmDialogBase | None [source]¶
- Return type:
Optional[QgsProcessingAlgorithmDialogBase]
- endUndoCommand(self)[source]¶
Ends the current undo command. This should be called after changes are made to the model.
- loadModel(self, path: str | None)[source]¶
Loads a model into the designer from the specified file
path
.- Parameters:
path (Optional[str])
- messageBar(self) QgsMessageBar | None [source]¶
- Return type:
Optional[QgsMessageBar]
- model(self) QgsProcessingModelAlgorithm | None [source]¶
Returns the model shown in the dialog.
- Return type:
Optional[QgsProcessingModelAlgorithm]
- saveModel(self, saveAs: bool = False) bool [source]¶
- Parameters:
saveAs (bool = False)
- Return type:
bool
- setLastRunResult(self, result: QgsProcessingModelResult)[source]¶
Sets the
result
of the last run of the model through the designer window.- Parameters:
result (QgsProcessingModelResult)
- setModel(self, model: QgsProcessingModelAlgorithm | None)[source]¶
Sets the
model
shown in the dialog.Ownership of
model
is transferred to the dialog.- Parameters:
model (Optional[QgsProcessingModelAlgorithm])
- setModelName(self, name: str | None)[source]¶
Sets the model
name
.Updates both the name text edit and the model name itself.
Added in version 3.24.
- Parameters:
name (Optional[str])
- setModelScene(self, scene: QgsModelGraphicsScene | None)[source]¶
Sets the related
scene
.- Parameters:
scene (Optional[QgsModelGraphicsScene])
- validateSave(self, action: QgsModelDesignerDialog.SaveAction) bool [source]¶
Checks if the model can current be saved, and returns
True
if it can.- Parameters:
action (QgsModelDesignerDialog.SaveAction)
- Return type:
bool