内容表

上一话题

QGraphicsLinearLayout

下一话题

QGraphicsOpacityEffect

QGraphicsObject

QGraphicsObject class provides a base class for all graphics items that require signals, slots and properties. 更多

Inheritance diagram of PySide2.QtWidgets.QGraphicsObject

继承者: QtCharts.QChart , QtCharts.QLegend , QtCharts.QPolarChart , QGraphicsVideoItem , QGraphicsSvgItem , QGraphicsProxyWidget , QGraphicsTextItem , QGraphicsWidget

4.6 版新增。

详细描述

类扩展 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.

父级和子级

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() 函数为 QWidget 子类。

另请参阅

QGraphicsWidget

class QGraphicsObject ( [ parent=None ] )
param parent

QGraphicsItem

构造 QGraphicsObject with parent .

PySide2.QtWidgets.QGraphicsObject. childrenChanged ( )
PySide2.QtWidgets.QGraphicsObject. enabledChanged ( )
PySide2.QtWidgets.QGraphicsObject. grabGesture ( type [ , flags=Qt.GestureFlags() ] )
参数
  • type GestureType

  • flags GestureFlags

Subscribes the graphics object to the given gesture 采有特定 flags .

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 )
参数

type GestureType

Unsubscribes the graphics object from the given gesture .

PySide2.QtWidgets.QGraphicsObject. visibleChanged ( )
PySide2.QtWidgets.QGraphicsObject. widthChanged ( )
PySide2.QtWidgets.QGraphicsObject. xChanged ( )
PySide2.QtWidgets.QGraphicsObject. yChanged ( )
PySide2.QtWidgets.QGraphicsObject. zChanged ( )