Class: QgsModelDesignerDialog

class qgis.gui.QgsModelDesignerDialog

Bases: PyQt5.QtWidgets.QMainWindow

Model designer dialog base class

Warning

Not stable API

Added in version 3.14:

Enums

SaveAction

Bases: enum.IntEnum

Methods

actionEvent

actionOpen

rtype:

Optional[QAction]

actionRun

rtype:

Optional[QAction]

actionSaveInProject

rtype:

Optional[QAction]

activate

Raise, unminimize and activate this window.

addAlgorithm

param algorithmId:

addInput

param inputId:

beginUndoCommand

Starts an undo command.

changeEvent

checkForUnsavedChanges

Checks if there are unsaved changes in the model, and if so, prompts the user to save them.

childEvent

closeEvent

param event:

connectNotify

contextMenuEvent

create

createExecutionDialog

rtype:

Optional[QgsProcessingAlgorithmDialogBase]

customEvent

destroy

disconnectNotify

dragEnterEvent

dragLeaveEvent

dragMoveEvent

dropEvent

endUndoCommand

Ends the current undo command.

enterEvent

event

exportAsScriptAlgorithm

focusInEvent

focusNextChild

focusNextPrevChild

focusOutEvent

focusPreviousChild

hideEvent

initPainter

inputMethodEvent

isSignalConnected

keyPressEvent

keyReleaseEvent

leaveEvent

loadModel

Loads a model into the designer from the specified file path.

messageBar

rtype:

Optional[QgsMessageBar]

metric

model

Returns the model shown in the dialog.

mouseDoubleClickEvent

mouseMoveEvent

mousePressEvent

mouseReleaseEvent

moveEvent

nativeEvent

paintEvent

receivers

repaintModel

param showControls:

resizeEvent

saveModel

param saveAs:

sender

senderSignalIndex

setDirty

param dirty:

setLastRunResult

Sets the result of the last run of the model through the designer window.

setModel

Sets the model shown in the dialog.

setModelName

Sets the model name.

setModelScene

Sets the related scene.

sharedPainter

showEvent

tabletEvent

timerEvent

toolbar

rtype:

Optional[QToolBar]

updateMicroFocus

validateSave

Checks if the model can current be saved, and returns True if it can.

view

rtype:

Optional[QGraphicsView]

wheelEvent

class SaveAction(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: enum.IntEnum

Save action.

Added in version 3.24.

  • SaveAsFile: Save model as a file

  • SaveInProject: Save model into project

SaveAsFile = 0
SaveInProject = 1
actionEvent(self, a0: QActionEvent | None)
actionOpen(self) QAction | None
Return type:

Optional[QAction]

actionRun(self) QAction | None
Return type:

Optional[QAction]

actionSaveInProject(self) QAction | None
Return type:

Optional[QAction]

activate(self)

Raise, unminimize and activate this window.

Added in version 3.24.

addAlgorithm(self, algorithmId: str | None, pos: QPointF | QPoint)
Parameters:
  • algorithmId (Optional[str])

  • pos (Union[QPointF)

addInput(self, inputId: str | None, pos: QPointF | QPoint)
Parameters:
  • inputId (Optional[str])

  • pos (Union[QPointF)

beginUndoCommand(self, text: str | None, id: int = 0)

Starts an undo command. This should be called before any changes are made to the model.

Parameters:
  • text (Optional[str])

  • id (int = 0)

changeEvent(self, a0: QEvent | None)
checkForUnsavedChanges(self) bool

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

childEvent(self, a0: QChildEvent | None)
closeEvent(self, event: QCloseEvent | None)
Parameters:

event (Optional[QCloseEvent])

connectNotify(self, signal: QMetaMethod)
contextMenuEvent(self, event: QContextMenuEvent | None)
create(self, window: PyQt5.sip.voidptr = None, initializeWindow: bool = True, destroyOldWindow: bool = True)
createExecutionDialog(self) QgsProcessingAlgorithmDialogBase | None
Return type:

Optional[QgsProcessingAlgorithmDialogBase]

customEvent(self, a0: QEvent | None)
destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)
disconnectNotify(self, signal: QMetaMethod)
dragEnterEvent(self, a0: QDragEnterEvent | None)
dragLeaveEvent(self, a0: QDragLeaveEvent | None)
dragMoveEvent(self, a0: QDragMoveEvent | None)
dropEvent(self, a0: QDropEvent | None)
endUndoCommand(self)

Ends the current undo command. This should be called after changes are made to the model.

enterEvent(self, a0: QEvent | None)
event(self, event: QEvent | None) bool
exportAsScriptAlgorithm(self)
focusInEvent(self, a0: QFocusEvent | None)
focusNextChild(self) bool
focusNextPrevChild(self, next: bool) bool
focusOutEvent(self, a0: QFocusEvent | None)
focusPreviousChild(self) bool
hideEvent(self, a0: QHideEvent | None)
initPainter(self, painter: QPainter | None)
inputMethodEvent(self, a0: QInputMethodEvent | None)
isSignalConnected(self, signal: QMetaMethod) bool
keyPressEvent(self, a0: QKeyEvent | None)
keyReleaseEvent(self, a0: QKeyEvent | None)
leaveEvent(self, a0: QEvent | None)
loadModel(self, path: str | None)

Loads a model into the designer from the specified file path.

Parameters:

path (Optional[str])

messageBar(self) QgsMessageBar | None
Return type:

Optional[QgsMessageBar]

metric(self, a0: QPaintDevice.PaintDeviceMetric) int
model(self) QgsProcessingModelAlgorithm | None

Returns the model shown in the dialog.

Return type:

Optional[QgsProcessingModelAlgorithm]

mouseDoubleClickEvent(self, a0: QMouseEvent | None)
mouseMoveEvent(self, a0: QMouseEvent | None)
mousePressEvent(self, a0: QMouseEvent | None)
mouseReleaseEvent(self, a0: QMouseEvent | None)
moveEvent(self, a0: QMoveEvent | None)
nativeEvent(self, eventType: QByteArray | bytes | bytearray, message: PyQt5.sip.voidptr | None)
paintEvent(self, a0: QPaintEvent | None)
receivers(self, signal: PYQT_SIGNAL) int
repaintModel(self, showControls: bool = True)
Parameters:

showControls (bool = True)

resizeEvent(self, a0: QResizeEvent | None)
saveModel(self, saveAs: bool = False) bool
Parameters:

saveAs (bool = False)

Return type:

bool

sender(self) QObject | None
senderSignalIndex(self) int
setDirty(self, dirty: bool)
Parameters:

dirty (bool)

setLastRunResult(self, result: QgsProcessingModelResult)

Sets the result of the last run of the model through the designer window.

Parameters:

result (QgsProcessingModelResult)

setModel(self, model: QgsProcessingModelAlgorithm | None)

Sets the model shown in the dialog.

Ownership of model is transferred to the dialog.

Parameters:

model (Optional[QgsProcessingModelAlgorithm])

setModelName(self, name: str | None)

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)

Sets the related scene.

Parameters:

scene (Optional[QgsModelGraphicsScene])

sharedPainter(self) QPainter | None
showEvent(self, a0: QShowEvent | None)
tabletEvent(self, a0: QTabletEvent | None)
timerEvent(self, a0: QTimerEvent | None)
toolbar(self) QToolBar | None
Return type:

Optional[QToolBar]

updateMicroFocus(self)
validateSave(self, action: QgsModelDesignerDialog.SaveAction) bool

Checks if the model can current be saved, and returns True if it can.

Parameters:

action (QgsModelDesignerDialog.SaveAction)

Return type:

bool

view(self) QGraphicsView | None
Return type:

Optional[QGraphicsView]

wheelEvent(self, a0: QWheelEvent | None)