node_graphics_node Module¶
A module containing Graphics representation of Node
-
class
nodeeditor.node_graphics_node.QDMGraphicsNode(node: Node, parent: PyQt5.QtWidgets.QWidget = None)¶ Bases:
PyQt5.QtWidgets.QGraphicsItemClass describing Graphics representation of
Node- Parameters
- Instance Attributes
node - reference to
Node
-
property
content¶ Reference to Node Content
-
property
title¶ title of this Node
- Getter
current Graphics Node title
- Setter
stores and make visible the new title
- Type
str
-
initUI()¶ Set up this
QGraphicsItem
-
initSizes()¶ Set up internal attributes like width, height, etc.
-
initAssets()¶ Initialize
QObjectslikeQColor,QPenandQBrush
-
onSelected()¶ Our event handling when the node was selected
-
doSelect(new_state=True)¶ Safe version of selecting the Graphics Node. Takes care about the selection state flag used internally
- Parameters
new_state (
bool) –Trueto select,Falseto deselect
-
mouseMoveEvent(event)¶ Overridden event to detect that we moved with this Node
-
mouseReleaseEvent(event)¶ Overriden event to handle when we moved, selected or deselected this Node
-
mouseDoubleClickEvent(event)¶ Overriden event for doubleclick. Resend to Node::onDoubleClicked
-
hoverEnterEvent(event: PyQt5.QtWidgets.QGraphicsSceneHoverEvent) → None¶ Handle hover effect
-
hoverLeaveEvent(event: PyQt5.QtWidgets.QGraphicsSceneHoverEvent) → None¶ Handle hover effect
-
boundingRect() → PyQt5.QtCore.QRectF¶ Defining Qt’ bounding rectangle
-
initTitle()¶ Set up the title Graphics representation: font, color, position, etc.
-
initContent()¶ Set up the grContent -
QGraphicsProxyWidgetto have a container for Graphics Content
-
paint(painter, QStyleOptionGraphicsItem, widget=None)¶ Painting the rounded rectanglar Node