QGraphicsObject#
The QGraphicsObject
class provides a base class for all graphics items that require signals, slots and properties. More…
Inherited by: QGraphicsWidget, QGraphicsProxyWidget, QGraphicsTextItem, QGraphicsSvgItem, QGraphicsVideoItem, QLegend, QChart, QPolarChart
New in version 4.6.
Synopsis#
Functions#
def
grabGesture
(type[, flags=Qt.GestureFlags()])def
ungrabGesture
(type)
Signals#
def
childrenChanged
()def
enabledChanged
()def
heightChanged
()def
opacityChanged
()def
parentChanged
()def
rotationChanged
()def
scaleChanged
()def
visibleChanged
()def
widthChanged
()def
xChanged
()def
yChanged
()def
zChanged
()
Detailed Description#
The class extends a QGraphicsItem
with QObject
‘s signal/slot and property mechanisms. It maps many of QGraphicsItem
‘s basic setters and getters to properties and adds notification signals for many of them.
Parents and Children#
Each graphics object can be constructed with a parent item. This ensures that the item will be destroyed when its parent item is destroyed. Although QGraphicsObject
inherits from both QObject
and QGraphicsItem
, you should use the functions provided by QGraphicsItem
, not QObject
, to manage the relationships between parent and child items.
The relationships between items can be explored using the parentItem()
and childItems()
functions. In the hierarchy of items in a scene, the parentObject()
and parentWidget()
functions are the equivalent of the parent()
and parentWidget()
functions for QWidget
subclasses.
See also
- class PySide6.QtWidgets.QGraphicsObject([parent=None])#
- Parameters
parent –
PySide6.QtWidgets.QGraphicsItem
Constructs a QGraphicsObject
with parent
.
- PySide6.QtWidgets.QGraphicsObject.childrenChanged()#
- PySide6.QtWidgets.QGraphicsObject.enabledChanged()#
This signal gets emitted whenever the item gets enabled or disabled.
See also
- PySide6.QtWidgets.QGraphicsObject.grabGesture(type[, flags=Qt.GestureFlags()])#
- Parameters
type –
GestureType
flags –
GestureFlags
Subscribes the graphics object to the given gesture
with specific flags
.
See also
- PySide6.QtWidgets.QGraphicsObject.heightChanged()#
- PySide6.QtWidgets.QGraphicsObject.opacityChanged()#
This signal gets emitted whenever the opacity of the item changes
See also
- PySide6.QtWidgets.QGraphicsObject.parentChanged()#
This signal gets emitted whenever the parent of the item changes
- PySide6.QtWidgets.QGraphicsObject.rotationChanged()#
This signal gets emitted whenever the rotation of the item changes.
- PySide6.QtWidgets.QGraphicsObject.scaleChanged()#
This signal is emitted when the scale of the item changes.
- PySide6.QtWidgets.QGraphicsObject.ungrabGesture(type)#
- Parameters
type –
GestureType
Unsubscribes the graphics object from the given gesture
.
See also
- PySide6.QtWidgets.QGraphicsObject.visibleChanged()#
This signal gets emitted whenever the visibility of the item changes
See also
visible
- PySide6.QtWidgets.QGraphicsObject.widthChanged()#
- PySide6.QtWidgets.QGraphicsObject.xChanged()#
This signal gets emitted whenever the x position of the item changes
See also
- PySide6.QtWidgets.QGraphicsObject.yChanged()#
This signal gets emitted whenever the y position of the item changes.
See also
- PySide6.QtWidgets.QGraphicsObject.zChanged()#
This signal gets emitted whenever the z value of the item changes.
See also