Class: QgsModelGraphicsScene¶
QGraphicsScene subclass representing the model designer.
Warning
Not stable API
Added in version 3.14.
Class Hierarchy¶
Base classes¶
- class qgis.gui.QgsModelGraphicsScene[source]¶
Bases:
QGraphicsScene- __init__(parent: QObject | None = None)
Constructor for QgsModelGraphicsScene with the specified
parentobject.- Parameters:
parent (Optional[QObject] = None)
- ArrowLink = 1¶
- class Flag¶
Bases:
int
- FlagHideComments = 4¶
- FlagHideControls = 2¶
- class Flags¶
- class Flags(f: QgsModelGraphicsScene.Flags | QgsModelGraphicsScene.Flag)
- class Flags(a0: QgsModelGraphicsScene.Flags)
Bases:
object
- GroupBox = 0¶
- ModelComponent = 2¶
- MouseHandles = 99¶
- RubberBand = 100¶
- ZSnapIndicator = 101¶
- class ZValues¶
Bases:
int
- childAlgorithmItem(self, childId: str | None) QgsModelChildAlgorithmGraphicItem | None[source]¶
Returns the graphic item corresponding to the specified child algorithm
Added in version 3.44.
- Parameters:
childId (Optional[str])
- Return type:
Optional[QgsModelChildAlgorithmGraphicItem]
- signal componentAboutToChange[source]¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- signal componentChanged[source]¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- componentItemAt(self, position: QPointF | QPoint) QgsModelComponentGraphicItem | None[source]¶
Returns the topmost component item at a specified
position.- Parameters:
position (Union[QPointF, QPoint])
- Return type:
Optional[QgsModelComponentGraphicItem]
- virtual createChildAlgGraphicItem(self, model: QgsProcessingModelAlgorithm | None, child: QgsProcessingModelChildAlgorithm | None) QgsModelChildAlgorithmGraphicItem | None[source]¶
Creates a new graphic item for a model child algorithm.
- Parameters:
model (Optional[QgsProcessingModelAlgorithm])
child (Optional[QgsProcessingModelChildAlgorithm])
- Return type:
Optional[QgsModelChildAlgorithmGraphicItem]
- virtual createCommentGraphicItem(self, model: QgsProcessingModelAlgorithm | None, comment: QgsProcessingModelComment | None, parentItem: QgsModelComponentGraphicItem | None) QgsModelComponentGraphicItem | None[source]¶
Creates a new graphic item for a model comment.
- Parameters:
model (Optional[QgsProcessingModelAlgorithm])
comment (Optional[QgsProcessingModelComment])
parentItem (Optional[QgsModelComponentGraphicItem])
- Return type:
Optional[QgsModelComponentGraphicItem]
- createGroupBoxGraphicItem(self, model: QgsProcessingModelAlgorithm | None, box: QgsProcessingModelGroupBox | None) QgsModelComponentGraphicItem | None[source]¶
Creates a new graphic item for a model group box.
- Parameters:
model (Optional[QgsProcessingModelAlgorithm])
box (Optional[QgsProcessingModelGroupBox])
- Return type:
Optional[QgsModelComponentGraphicItem]
- createItems(self, model: QgsProcessingModelAlgorithm | None, context: QgsProcessingContext)[source]¶
Populates the scene by creating items representing the specified
model.- Parameters:
model (Optional[QgsProcessingModelAlgorithm])
context (QgsProcessingContext)
- virtual createOutputGraphicItem(self, model: QgsProcessingModelAlgorithm | None, output: QgsProcessingModelOutput | None) QgsModelComponentGraphicItem | None[source]¶
Creates a new graphic item for a model output.
- Parameters:
model (Optional[QgsProcessingModelAlgorithm])
output (Optional[QgsProcessingModelOutput])
- Return type:
Optional[QgsModelComponentGraphicItem]
- virtual createParameterGraphicItem(self, model: QgsProcessingModelAlgorithm | None, param: QgsProcessingModelParameter | None) QgsModelComponentGraphicItem | None[source]¶
Creates a new graphic item for a model parameter.
- Parameters:
model (Optional[QgsProcessingModelAlgorithm])
param (Optional[QgsProcessingModelParameter])
- Return type:
Optional[QgsModelComponentGraphicItem]
- deselectAll(self)[source]¶
Clears any selected items in the scene.
Call this method rather than QGraphicsScene.clearSelection, as the latter does not correctly emit signals to allow the scene’s model to update.
- flags(self) QgsModelGraphicsScene.Flags[source]¶
Returns the current combination of flags set for the scene.
See also
See also
- Return type:
- groupBoxItem(self, uuid: str | None) QgsModelComponentGraphicItem | None[source]¶
Returns the graphic item corresponding to the specified group box
uuid.- Parameters:
uuid (Optional[str])
- Return type:
Optional[QgsModelComponentGraphicItem]
- messageBar(self) QgsMessageBar | None[source]¶
Returns the message bar associated with the scene.
See also
- Return type:
Optional[QgsMessageBar]
- model(self) QgsProcessingModelAlgorithm | None[source]¶
- Return type:
Optional[QgsProcessingModelAlgorithm]
- parameterItem(self, name: str | None) QgsModelComponentGraphicItem | None[source]¶
Returns the
QgsModelComponentGraphicItemcorresponding to the specified child algorithmAdded in version 3.44.
- Parameters:
name (Optional[str])
- Return type:
Optional[QgsModelComponentGraphicItem]
- signal rebuildRequired[source]¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- requestRebuildRequired(self)[source]¶
Requests a complete rebuild of a model by emitting the according signal
Added in version 3.44.
- signal runFromChild[source]¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- signal runSelected[source]¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- selectedComponentItems(self) List[QgsModelComponentGraphicItem]¶
Returns list of selected component items.
- Return type:
- signal selectedItemChanged[source]¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- setFlag(self, flag: QgsModelGraphicsScene.Flag, on: bool = True)[source]¶
Enables or disables a particular
flagfor the scene. Other existing flags are not affected.See also
See also
- Parameters:
flag (QgsModelGraphicsScene.Flag)
on (bool = True)
- setFlags(self, flags: QgsModelGraphicsScene.Flags | QgsModelGraphicsScene.Flag)[source]¶
Sets the combination of
flagscontrolling how the scene is rendered and behaves.See also
See also
- Parameters:
flags (Union[QgsModelGraphicsScene.Flags, QgsModelGraphicsScene.Flag])
- setLastRunResult(self, result: QgsProcessingModelResult)[source]¶
Sets the
resultof the last run of the model through the designer window.- Parameters:
result (QgsProcessingModelResult)
- setMessageBar(self, bar: QgsMessageBar | None)[source]¶
Sets the message
barassociated with the scene.See also
- Parameters:
bar (Optional[QgsMessageBar])
- setModel(self, model: QgsProcessingModelAlgorithm | None)[source]¶
- Parameters:
model (Optional[QgsProcessingModelAlgorithm])
- setSelectedItem(self, item: QgsModelComponentGraphicItem | None)[source]¶
Clears any selected items and sets
itemas the current selection.- Parameters:
item (Optional[QgsModelComponentGraphicItem])
- signal showChildAlgorithmLog[source]¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- signal showChildAlgorithmOutputs[source]¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- showWarning(self, shortMessage: str | None, title: str | None, longMessage: str | None, level: Qgis.MessageLevel = Qgis.MessageLevel.Warning)[source]¶
Shows a warning message, allowing users to click a button to see the full details (
longMessage).- Parameters:
shortMessage (Optional[str])
title (Optional[str])
longMessage (Optional[str])
level (Qgis.MessageLevel = Qgis.MessageLevel.Warning)