PyFlow.UI.Canvas package

Submodules

PyFlow.UI.Canvas.AutoPanController module

PyFlow.UI.Canvas.CanvasBase module

class PyFlow.UI.Canvas.CanvasBase.CanvasBase

Bases: PySide2.QtWidgets.QGraphicsView

__init__()

Initialize self. See help(type(self)) for accurate signature.

drawBackground(self, painter: PySide2.QtGui.QPainter, rect: PySide2.QtCore.QRectF)
frameRect(self) → PySide2.QtCore.QRect
wheelEvent(self, event: PySide2.QtGui.QWheelEvent)

PyFlow.UI.Canvas.IConvexHullBackDrop module

class PyFlow.UI.Canvas.IConvexHullBackDrop.IConvexHullBackDrop

Bases: object

Convex hull backdrop routines. Used by for loop and while loop nodes

__init__()

Initialize self. See help(type(self)) for accurate signature.

PyFlow.UI.Canvas.NodeActionButton module

class PyFlow.UI.Canvas.NodeActionButton.NodeActionButtonBase(svgFilePath, action, uiNode)

Bases: PySide2.QtWidgets.QGraphicsWidget

Base class for all node’s actions buttons.

By default it calls action triggered signal. Have default svg 10x10 icon.

__init__(svgFilePath, action, uiNode)

Initialize self. See help(type(self)) for accurate signature.

hoverEnterEvent(self, event: PySide2.QtWidgets.QGraphicsSceneHoverEvent)
hoverLeaveEvent(self, event: PySide2.QtWidgets.QGraphicsSceneHoverEvent)
mousePressEvent(self, event: PySide2.QtWidgets.QGraphicsSceneMouseEvent)
setGeometry(self, rect: PySide2.QtCore.QRectF)

setGeometry(self, x: float, y: float, w: float, h: float)

sizeHint(self, which: PySide2.QtCore.Qt.SizeHint, constraint: PySide2.QtCore.QSizeF = Default(QSizeF)) → PySide2.QtCore.QSizeF

PyFlow.UI.Canvas.Painters module

PyFlow.UI.Canvas.SelectionRect module

class PyFlow.UI.Canvas.SelectionRect.SelectionRect(graph, mouseDownPos, modifiers)

Bases: PySide2.QtWidgets.QGraphicsWidget

__init__(graph, mouseDownPos, modifiers)

Initialize self. See help(type(self)) for accurate signature.

collidesWithItem(self, other: PySide2.QtWidgets.QGraphicsItem, mode: PySide2.QtCore.Qt.ItemSelectionMode = PySide2.QtCore.Qt.ItemSelectionMode.IntersectsItemShape) → bool
paint(self, painter: PySide2.QtGui.QPainter, option: PySide2.QtWidgets.QStyleOptionGraphicsItem, widget: typing.Union[PySide2.QtWidgets.QWidget, NoneType] = None)

PyFlow.UI.Canvas.UICommon module

class PyFlow.UI.Canvas.UICommon.CanvasManipulationMode

Bases: enum.IntEnum

An enumeration.

class PyFlow.UI.Canvas.UICommon.CanvasState

Bases: enum.IntEnum

An enumeration.

class PyFlow.UI.Canvas.UICommon.NodeActionButtonInfo(defaultSvgIcon, actionButtonClass=None)

Bases: object

Used to populate node header with buttons representing node’s actions from node’s menu.

See UINodeBase constructor and postCrate method.

__init__(defaultSvgIcon, actionButtonClass=None)

Initialize self. See help(type(self)) for accurate signature.

class PyFlow.UI.Canvas.UICommon.VisibilityPolicy

Bases: enum.IntEnum

An enumeration.

PyFlow.UI.Canvas.UICommon.fetchPackageNames(graphJson)

Parses serialized graph and returns all package names it uses

Parameters:graphJson (dict) – Serialized graph
Rtyoe:list(str)
PyFlow.UI.Canvas.UICommon.validateGraphDataPackages(graphData, missedPackages={})

Checks if packages used in serialized data accessible

Missed packages will be added to output set

Parameters:
  • graphData (dict) – Serialized graph
  • missedPackages (str) – Package names that missed
Return type:

bool

PyFlow.UI.Canvas.UIConnection module

class PyFlow.UI.Canvas.UIConnection.UIConnection(source, destination, canvas)

Bases: PySide2.QtWidgets.QGraphicsPathItem

UIConnection is a cubic spline curve. It represents connection between two pins.

__init__(source, destination, canvas)

Initialize self. See help(type(self)) for accurate signature.

contextMenuEvent(self, event: PySide2.QtWidgets.QGraphicsSceneContextMenuEvent)
hoverEnterEvent(self, event: PySide2.QtWidgets.QGraphicsSceneHoverEvent)
hoverLeaveEvent(self, event: PySide2.QtWidgets.QGraphicsSceneHoverEvent)
hoverMoveEvent(self, event: PySide2.QtWidgets.QGraphicsSceneHoverEvent)
mouseMoveEvent(self, event: PySide2.QtWidgets.QGraphicsSceneMouseEvent)
mousePressEvent(self, event: PySide2.QtWidgets.QGraphicsSceneMouseEvent)
mouseReleaseEvent(self, event: PySide2.QtWidgets.QGraphicsSceneMouseEvent)
paint(self, painter: PySide2.QtGui.QPainter, option: PySide2.QtWidgets.QStyleOptionGraphicsItem, widget: typing.Union[PySide2.QtWidgets.QWidget, NoneType] = None)
setSelected(self, selected: bool)
shape(self) → PySide2.QtGui.QPainterPath

PyFlow.UI.Canvas.UINodeBase module

class PyFlow.UI.Canvas.UINodeBase.CollapseNodeActionButton(svgFilePath, action, uiNode)

Bases: PyFlow.UI.Canvas.NodeActionButton.NodeActionButtonBase

docstring for CollapseNodeActionButton.

__init__(svgFilePath, action, uiNode)

Initialize self. See help(type(self)) for accurate signature.

mousePressEvent(self, event: PySide2.QtWidgets.QGraphicsSceneMouseEvent)
class PyFlow.UI.Canvas.UINodeBase.InputTextField(text, node, parent=None, singleLine=False, validator=None)

Bases: PySide2.QtWidgets.QGraphicsTextItem

__init__(text, node, parent=None, singleLine=False, validator=None)

Initialize self. See help(type(self)) for accurate signature.

focusInEvent(self, event: PySide2.QtGui.QFocusEvent)
focusOutEvent(self, event: PySide2.QtGui.QFocusEvent)
keyPressEvent(self, event: PySide2.QtGui.QKeyEvent)
mouseDoubleClickEvent(self, event: PySide2.QtWidgets.QGraphicsSceneMouseEvent)
mousePressEvent(self, event: PySide2.QtWidgets.QGraphicsSceneMouseEvent)
mouseReleaseEvent(self, event: PySide2.QtWidgets.QGraphicsSceneMouseEvent)
class PyFlow.UI.Canvas.UINodeBase.NodeName(parent=None)

Bases: PySide2.QtWidgets.QGraphicsWidget

docstring for NodeName

__init__(parent=None)

Initialize self. See help(type(self)) for accurate signature.

hoverEnterEvent(self, event: PySide2.QtWidgets.QGraphicsSceneHoverEvent)
hoverLeaveEvent(self, event: PySide2.QtWidgets.QGraphicsSceneHoverEvent)
hoverMoveEvent(self, event: PySide2.QtWidgets.QGraphicsSceneHoverEvent)
mouseDoubleClickEvent(self, event: PySide2.QtWidgets.QGraphicsSceneMouseEvent)
setGeometry(self, rect: PySide2.QtCore.QRectF)

setGeometry(self, x: float, y: float, w: float, h: float)

sizeHint(self, which: PySide2.QtCore.Qt.SizeHint, constraint: PySide2.QtCore.QSizeF = Default(QSizeF)) → PySide2.QtCore.QSizeF
class PyFlow.UI.Canvas.UINodeBase.NodeNameValidator(parent=None)

Bases: PySide2.QtGui.QRegExpValidator

docstring for NodeNameValidator.

__init__(parent=None)

Initialize self. See help(type(self)) for accurate signature.

class PyFlow.UI.Canvas.UINodeBase.UINodeBase(raw_node, w=80, color=PySide2.QtGui.QColor.fromRgbF(0.156863, 0.156863, 0.156863, 0.784314), headColorOverride=None)

Bases: PySide2.QtWidgets.QGraphicsWidget, PyFlow.UI.UIInterfaces.IPropertiesViewSupport, PyFlow.UI.UIInterfaces.IUINode

Default node description

__init__(raw_node, w=80, color=PySide2.QtGui.QColor.fromRgbF(0.156863, 0.156863, 0.156863, 0.784314), headColorOverride=None)

Initialize self. See help(type(self)) for accurate signature.

aboutToCollapse(futureCollapseState)

Called before collapsing or expanding.

contextMenuEvent(self, event: PySide2.QtWidgets.QGraphicsSceneContextMenuEvent)
finalizeRename(accepted=False)

Called by NodeName

If user pressed escape name before editing will be restored. If User pressed enter or removed focus rename action will be accepted and node will be renamed and name will be checked for uniqueness.

Parameters:accepted (bool) – Wheter user accepted editing or not
getTopMostOwningCollapsedComment()

Returns top most owning comment. If bCollapsed=True, it will stop when first collapsed comment is found.

hoverLeaveEvent(self, event: PySide2.QtWidgets.QGraphicsSceneHoverEvent)
hoverMoveEvent(self, event: PySide2.QtWidgets.QGraphicsSceneHoverEvent)
itemChange(self, change: PySide2.QtWidgets.QGraphicsItem.GraphicsItemChange, value: typing.Any) → typing.Any
mouseMoveEvent(self, event: PySide2.QtWidgets.QGraphicsSceneMouseEvent)
mousePressEvent(self, event: PySide2.QtWidgets.QGraphicsSceneMouseEvent)
mouseReleaseEvent(self, event: PySide2.QtWidgets.QGraphicsSceneMouseEvent)
paint(self, painter: PySide2.QtGui.QPainter, option: PySide2.QtWidgets.QStyleOptionGraphicsItem, widget: typing.Union[PySide2.QtWidgets.QWidget, NoneType] = None)
setData(self, key: int, value: typing.Any)
setGeometry(self, rect: PySide2.QtCore.QRectF)

setGeometry(self, x: float, y: float, w: float, h: float)

sizeHint(self, which: PySide2.QtCore.Qt.SizeHint, constraint: PySide2.QtCore.QSizeF = Default(QSizeF)) → PySide2.QtCore.QSizeF

PyFlow.UI.Canvas.UIPinBase module

class PyFlow.UI.Canvas.UIPinBase.PinGroup(owningNode, direction, name='groupName')

Bases: PyFlow.UI.Canvas.UIPinBase.UIPinBase

docstring for PinGroup.

__init__(owningNode, direction, name='groupName')

UI wrapper for PyFlow.Core.PinBase

Parameters:
  • owningNode (PyFlow.UI.Canvas.NodeBase) – Owning node
  • raw_pin (PyFlow.Core.PinBase) – PinBase reference
contextMenuEvent(self, event: PySide2.QtWidgets.QGraphicsSceneContextMenuEvent)
hoverEnterEvent(self, event: PySide2.QtWidgets.QGraphicsSceneHoverEvent)
hoverLeaveEvent(self, event: PySide2.QtWidgets.QGraphicsSceneHoverEvent)
kill()

this will be called after raw pin is deleted

paint(self, painter: PySide2.QtGui.QPainter, option: PySide2.QtWidgets.QStyleOptionGraphicsItem, widget: typing.Union[PySide2.QtWidgets.QWidget, NoneType] = None)
sizeHint(self, which: PySide2.QtCore.Qt.SizeHint, constraint: PySide2.QtCore.QSizeF = Default(QSizeF)) → PySide2.QtCore.QSizeF
class PyFlow.UI.Canvas.UIPinBase.UIPinBase(owningNode, raw_pin)

Bases: PySide2.QtWidgets.QGraphicsWidget

UI pin wrapper.

__init__(owningNode, raw_pin)

UI wrapper for PyFlow.Core.PinBase

Parameters:
  • owningNode (PyFlow.UI.Canvas.NodeBase) – Owning node
  • raw_pin (PyFlow.Core.PinBase) – PinBase reference
contextMenuEvent(self, event: PySide2.QtWidgets.QGraphicsSceneContextMenuEvent)
hoverEnterEvent(self, event: PySide2.QtWidgets.QGraphicsSceneHoverEvent)
hoverLeaveEvent(self, event: PySide2.QtWidgets.QGraphicsSceneHoverEvent)
kill(*args, **kwargs)

this will be called after raw pin is deleted

paint(self, painter: PySide2.QtGui.QPainter, option: PySide2.QtWidgets.QStyleOptionGraphicsItem, widget: typing.Union[PySide2.QtWidgets.QWidget, NoneType] = None)
pinCenter()

Point relative to pin widget, where circle is drawn.

setData(self, key: int, value: typing.Any)
shape(self) → PySide2.QtGui.QPainterPath
sizeHint(self, which: PySide2.QtCore.Qt.SizeHint, constraint: PySide2.QtCore.QSizeF = Default(QSizeF)) → PySide2.QtCore.QSizeF

PyFlow.UI.Canvas.UIVariable module

class PyFlow.UI.Canvas.UIVariable.TypeWidget(keyColor, valueColor, parent=None)

Bases: PySide2.QtWidgets.QWidget

__init__(keyColor, valueColor, parent=None)

Initialize self. See help(type(self)) for accurate signature.

paintEvent(self, event: PySide2.QtGui.QPaintEvent)
class PyFlow.UI.Canvas.UIVariable.UIVariable(rawVariable, variablesWidget, parent=None)

Bases: PySide2.QtWidgets.QWidget, PyFlow.UI.UIInterfaces.IPropertiesViewSupport

__init__(rawVariable, variablesWidget, parent=None)

Initialize self. See help(type(self)) for accurate signature.

mousePressEvent(self, event: PySide2.QtGui.QMouseEvent)

PyFlow.UI.Canvas.WatchPinValueItem module

class PyFlow.UI.Canvas.WatchPinValueItem.WatchItem(text='')

Bases: PySide2.QtWidgets.QGraphicsTextItem

docstring for WatchItem.

__init__(text='')

Initialize self. See help(type(self)) for accurate signature.

paint(self, painter: PySide2.QtGui.QPainter, option: PySide2.QtWidgets.QStyleOptionGraphicsItem, widget: PySide2.QtWidgets.QWidget)

PyFlow.UI.Canvas.loopBackDrop module

class PyFlow.UI.Canvas.loopBackDrop.backDrop(parent)

Bases: PySide2.QtWidgets.QGraphicsWidget

__init__(parent)

Initialize self. See help(type(self)) for accurate signature.

boundingRect(self) → PySide2.QtCore.QRectF
paint(self, painter: PySide2.QtGui.QPainter, option: PySide2.QtWidgets.QStyleOptionGraphicsItem, widget: typing.Union[PySide2.QtWidgets.QWidget, NoneType] = None)

Module contents