QNodeEditor.graphics.node.NodeGraphics#
- class QNodeEditor.graphics.node.NodeGraphics(node: Node, theme: ~typing.Type[~QNodeEditor.themes.theme.Theme] = <class 'QNodeEditor.themes.dark.DarkTheme'>)#
Bases:
QGraphicsItemExtension of QGraphicsItem for drawing a node.
Properties
Get the height of the node.
Get or set the theme of the node.
Get or set the width of the node.
Methods
Create new node graphics.
boundingRectGet the bounding rectangle of the node.
Determine the top-left position of an entry relative to the node top-left corner.
hoverEnterEventUpdate the node graphics if the mouse is hovered over it.
hoverLeaveEventUpdate the node graphics if the mouse stops hovering over it.
itemChangeUpdate the node and connected edges if it was moved.
paintDraw the node.
Change the title of the node.
- __init__(node: Node, theme: ~typing.Type[~QNodeEditor.themes.theme.Theme] = <class 'QNodeEditor.themes.dark.DarkTheme'>)#
Create new node graphics.
- get_entry_geometry(entry: Entry) tuple[QPointF, float]#
Determine the top-left position of an entry relative to the node top-left corner.
- set_title(title: str) None#
Change the title of the node.
The title is automatically truncated if it would exceed the width of the node.
- Parameters:
title (str) – New title for the node
- Return type:
None
- property height: float#
Get the height of the node.
- property theme: Type[Theme]#
Get or set the theme of the node.
Setting the theme will apply the theme to all children elements.
- property width: float#
Get or set the width of the node.