Class: QgsModelGraphicsScene

class qgis.gui.QgsModelGraphicsScene(parent: QObject = None)

Bases: PyQt5.QtWidgets.QGraphicsScene

Constructor for QgsModelGraphicsScene with the specified parent object.

QGraphicsScene subclass representing the model designer.

Warning

Not stable API

New in version 3.14.

Parameters

parent

class Flag

Bases: int

FlagHideComments = 4
FlagHideControls = 2
class Flags

Bases: sip.wrapper

QgsModelGraphicsScene.Flags(Union[QgsModelGraphicsScene.Flags, QgsModelGraphicsScene.Flag]) QgsModelGraphicsScene.Flags(QgsModelGraphicsScene.Flags)

ModelComponent = 1
MouseHandles = 99
RubberBand = 100
ZSnapIndicator = 101
class ZValues

Bases: int

childEvent()
componentAboutToChange

Emitted whenever a component of the model is about to be changed.

The text argument gives the translated text describing the change about to occur, and the optional id can be used to group the associated undo commands. [signal]

Parameters
  • text (str) –

  • id (int = 0) –

componentChanged

Emitted whenever a component of the model is changed. [signal]

componentItemAt(self, position: Union[QPointF, QPoint])QgsModelComponentGraphicItem

Returns the topmost component item at a specified position.

Parameters

position (Union[QPointF) –

Return type

QgsModelComponentGraphicItem

connectNotify()
contextMenuEvent()
createChildAlgGraphicItem(self, model: QgsProcessingModelAlgorithm, child: QgsProcessingModelChildAlgorithm)QgsModelComponentGraphicItem

Creates a new graphic item for a model child algorithm.

Parameters
Return type

QgsModelComponentGraphicItem

createCommentGraphicItem(self, model: QgsProcessingModelAlgorithm, comment: QgsProcessingModelComment, parentItem: QgsModelComponentGraphicItem)QgsModelComponentGraphicItem

Creates a new graphic item for a model comment.

Parameters
Return type

QgsModelComponentGraphicItem

createItems(self, model: QgsProcessingModelAlgorithm, context: QgsProcessingContext)

Populates the scene by creating items representing the specified model.

Parameters
createOutputGraphicItem(self, model: QgsProcessingModelAlgorithm, output: QgsProcessingModelOutput)QgsModelComponentGraphicItem

Creates a new graphic item for a model output.

Parameters
Return type

QgsModelComponentGraphicItem

createParameterGraphicItem(self, model: QgsProcessingModelAlgorithm, param: QgsProcessingModelParameter)QgsModelComponentGraphicItem

Creates a new graphic item for a model parameter.

Parameters
Return type

QgsModelComponentGraphicItem

customEvent()
deselectAll(self)

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.

disconnectNotify()
dragEnterEvent()
dragLeaveEvent()
dragMoveEvent()
drawBackground()
drawForeground()
dropEvent()
event()
eventFilter()
flags(self) → QgsModelGraphicsScene.Flags

Returns the current combination of flags set for the scene.

See also

setFlags()

See also

setFlag()

Return type

QgsModelGraphicsScene.Flags

focusInEvent()
focusNextPrevChild()
focusOutEvent()
helpEvent()
inputMethodEvent()
isSignalConnected()
keyPressEvent()
keyReleaseEvent()
mouseDoubleClickEvent()
mouseMoveEvent()
mousePressEvent(self, event: QGraphicsSceneMouseEvent)
Parameters

event (QGraphicsSceneMouseEvent) –

mouseReleaseEvent()
rebuildRequired

Emitted when a change in the model requires a full rebuild of the scene. [signal]

receivers()
selectAll(self)

Selects all the components in the scene.

selectedComponentItems(self) → List[QgsModelComponentGraphicItem]

Returns list of selected component items.

Return type

List[QgsModelComponentGraphicItem]

selectedItemChanged

Emitted whenever the selected item changes. If None, no item is selected. [signal]

Parameters

selected (QgsModelComponentGraphicItem) –

sender()
senderSignalIndex()
setFlag(self, flag: QgsModelGraphicsScene.Flag, on: bool = True)

Enables or disables a particular flag for the scene. Other existing flags are not affected.

See also

setFlags()

See also

flags()

Parameters
setFlags(self, flags: Union[QgsModelGraphicsScene.Flags, QgsModelGraphicsScene.Flag])

Sets the combination of flags controlling how the scene is rendered and behaves.

See also

setFlag()

See also

flags()

Parameters

flags (Union[QgsModelGraphicsScene.Flags) –

setSelectedItem(self, item: QgsModelComponentGraphicItem)

Clears any selected items and sets item as the current selection.

Parameters

item (QgsModelComponentGraphicItem) –

timerEvent()
wheelEvent()