Class: QgsModelDesignerSocketGraphicItem

A socket allowing linking component together.

Warning

Not stable API

Added in version 3.44.

Class Hierarchy

Inheritance diagram of qgis.gui.QgsModelDesignerSocketGraphicItem

Base classes

QgsModelDesignerFlatButtonGraphicItem

A flat button graphic item for use in the Processing model designer.

QGraphicsObject

QObject

QGraphicsItem

Methods

component

Return the component associated to the socket.

componentItem

Return the parent graphic item associated to the socket.

edge

Returns on which edge this socket is:

index

Returns the index of this socket in either QgsModelDesignerSocketGraphicItem.mInSockets or QgsModelDesignerSocketGraphicItem.mOutSockets array

isInput

Returns whether the socket is an input socket or not.

class qgis.gui.QgsModelDesignerSocketGraphicItem[source]

Bases: QgsModelDesignerFlatButtonGraphicItem

__init__(parent: QgsModelComponentGraphicItem | None, component: QgsProcessingModelComponent | None, index: int, position: QPointF | QPoint, edge: Qt.Edge, size: QSizeF = QSizeF(11, 11))

Constructor for QgsModelDesignerSocketGraphicItem, with the specified parent item.

The index argument specifies whether the input or output index of this socket inside the component And the edge argument specifies if it’s an input socket( Qt.Edge.TopEdge ) or output ( Qt.Edge.BottomEdge )

The sockets will be rendered at the specified position

Parameters:
component(self) QgsProcessingModelComponent | None[source]

Return the component associated to the socket.

Return type:

Optional[QgsProcessingModelComponent]

componentItem(self) QgsModelComponentGraphicItem | None[source]

Return the parent graphic item associated to the socket.

Return type:

Optional[QgsModelComponentGraphicItem]

edge(self) Qt.Edge[source]

Returns on which edge this socket is:

  • Qt.Edge.TopEdge for input socket

  • Qt.Edge.BottomEdge for output socket

Return type:

Qt.Edge

index(self) int[source]

Returns the index of this socket in either QgsModelDesignerSocketGraphicItem.mInSockets or QgsModelDesignerSocketGraphicItem.mOutSockets array

Return type:

int

isInput(self) bool[source]

Returns whether the socket is an input socket or not.

Convenient function around mEdge member

Return type:

bool