QGraphicsObject¶
The
QGraphicsObject
class provides a base class for all graphics items that require signals, slots and properties. More…
Inherited by: QChart, QLegend, QPolarChart, QGraphicsVideoItem, QGraphicsSvgItem, QGraphicsProxyWidget, QGraphicsTextItem, QGraphicsWidget
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
withQObject
‘s signal/slot and property mechanisms. It maps many ofQGraphicsItem
‘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 bothQObject
andQGraphicsItem
, you should use the functions provided byQGraphicsItem
, notQObject
, to manage the relationships between parent and child items.The relationships between items can be explored using the
parentItem()
andchildItems()
functions. In the hierarchy of items in a scene, theparentObject()
andparentWidget()
functions are the equivalent of theparent()
andparentWidget()
functions forQWidget
subclasses.See also
- class PySide2.QtWidgets.QGraphicsObject([parent=None])¶
- param parent:
Constructs a
QGraphicsObject
withparent
.
- PySide2.QtWidgets.QGraphicsObject.childrenChanged()¶
- PySide2.QtWidgets.QGraphicsObject.enabledChanged()¶
- PySide2.QtWidgets.QGraphicsObject.grabGesture(type[, flags=Qt.GestureFlags()])¶
- Parameters:
type –
GestureType
flags –
GestureFlags
Subscribes the graphics object to the given
gesture
with specificflags
.See also
- PySide2.QtWidgets.QGraphicsObject.heightChanged()¶
- PySide2.QtWidgets.QGraphicsObject.opacityChanged()¶
- PySide2.QtWidgets.QGraphicsObject.parentChanged()¶
- PySide2.QtWidgets.QGraphicsObject.rotationChanged()¶
- PySide2.QtWidgets.QGraphicsObject.scaleChanged()¶
- PySide2.QtWidgets.QGraphicsObject.ungrabGesture(type)¶
- Parameters:
type –
GestureType
Unsubscribes the graphics object from the given
gesture
.See also
- PySide2.QtWidgets.QGraphicsObject.visibleChanged()¶
- PySide2.QtWidgets.QGraphicsObject.widthChanged()¶
- PySide2.QtWidgets.QGraphicsObject.xChanged()¶
- PySide2.QtWidgets.QGraphicsObject.yChanged()¶
- PySide2.QtWidgets.QGraphicsObject.zChanged()¶
© 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.