QGraphicsObject 类提供基类用于所有要求信号、槽及特性的图形项。 更多...
头: | #include <QGraphicsObject> |
qmake: | QT += widgets |
Since: | Qt 4.6 |
继承: | QObject and QGraphicsItem |
继承者: |
该类在 Qt 4.6 引入。
QGraphicsObject (QGraphicsItem * parent = nullptr) | |
virtual | ~QGraphicsObject () |
void | grabGesture (Qt::GestureType gesture , Qt::GestureFlags flags = Qt::GestureFlags()) |
void | ungrabGesture (Qt::GestureType gesture ) |
void | enabledChanged () |
void | opacityChanged () |
void | parentChanged () |
void | rotationChanged () |
void | scaleChanged () |
void | visibleChanged () |
void | xChanged () |
void | yChanged () |
void | zChanged () |
virtual bool | event (QEvent * ev ) override |
void | updateMicroFocus () |
类延伸 QGraphicsItem with QObject 的信号/槽和特性机制。它映射了很多 QGraphicsItem 基本 setter 和 getter 特性并为其中很多添加了通知信号。
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 ,应使用函数提供通过 QGraphicsItem , not QObject , to manage the relationships between parent and child items.
The relationships between items can be explored using the parentItem () 和 childItems () functions. In the hierarchy of items in a scene, the parentObject () 和 parentWidget () functions are the equivalent of the QWidget::parent () 和 QWidget::parentWidget () functions for QWidget 子类。
另请参阅 QGraphicsWidget .
此特性保持附加到此项的效果
该特性在 Qt 4.7 引入。
另请参阅 QGraphicsItem::setGraphicsEffect () 和 QGraphicsItem::graphicsEffect ().
This property holds whether the item is enabled or not
此特性的声明在 QGraphicsItem .
默认情况下,此特性为
true
.
通知程序信号:
void | enabledChanged () |
另请参阅 QGraphicsItem::isEnabled () 和 QGraphicsItem::setEnabled ().
此特性保持项的不透明度
通知程序信号:
void | opacityChanged () |
另请参阅 QGraphicsItem::setOpacity () 和 QGraphicsItem::opacity ().
This property holds the parent of the item
注意: The item's parent is set independently of the parent object returned by QObject::parent ().
通知程序信号:
void | parentChanged () |
另请参阅 QGraphicsItem::setParentItem () 和 QGraphicsItem::parentObject ().
此特性保持项的位置
另请参阅 QGraphicsItem::setPos () 和 QGraphicsItem::pos ().
This property holds the rotation of the item in degrees.
This specifies how many degrees to rotate the item around its transformOrigin. The default rotation is 0 degrees (i.e. not rotated at all).
通知程序信号:
void | rotationChanged () |
This property holds the scale of the item.
A scale of less than 1 means the item will be displayed smaller than normal, and a scale of greater than 1 means the item will be displayed larger than normal. A negative scale means the item will be mirrored.
By default, items are displayed at a scale of 1 (i.e. at their normal size).
Scaling is from the item's transformOrigin.
通知程序信号:
void | scaleChanged () |
This property holds the transformation origin
This property sets a specific point in the item's coordinate system as the origin for scale and rotation.
另请参阅 scale , rotation ,和 QGraphicsItem::transformOriginPoint ().
This property holds whether the item is visible or not
此特性的声明在 QGraphicsItem .
默认情况下,此特性为
true
.
通知程序信号:
void | visibleChanged () |
另请参阅 QGraphicsItem::isVisible () 和 QGraphicsItem::setVisible ().
This property holds the x position of the item
Describes the items x position.
通知程序信号:
void | xChanged () |
另请参阅 QGraphicsItem::setX () 和 setPos ().
This property holds the y position of the item
Describes the items y position.
通知程序信号:
void | yChanged () |
另请参阅 QGraphicsItem::setY () 和 setPos ().
This property holds the z value of the item
Describes the items z value.
通知程序信号:
void | zChanged () |
另请参阅 QGraphicsItem::setZValue () 和 zValue ().
Constructs a QGraphicsObject with parent .
[signal]
void
QGraphicsObject::
enabledChanged
()
This signal gets emitted whenever the item gets enabled or disabled.
注意: 通知程序信号对于特性 enabled .
另请参阅 isEnabled ().
[signal]
void
QGraphicsObject::
opacityChanged
()
This signal gets emitted whenever the opacity of the item changes
注意: 通知程序信号对于特性 opacity .
另请参阅 QGraphicsItem::opacity ().
[signal]
void
QGraphicsObject::
parentChanged
()
This signal gets emitted whenever the parent of the item changes
注意: 通知程序信号对于特性 parent .
[signal]
void
QGraphicsObject::
rotationChanged
()
This signal gets emitted whenever the rotation of the item changes.
注意: 通知程序信号对于特性 rotation .
[signal]
void
QGraphicsObject::
scaleChanged
()
This signal is emitted when the scale of the item changes.
注意: 通知程序信号对于特性 scale .
[protected slot]
void
QGraphicsObject::
updateMicroFocus
()
Updates the item's micro focus. This is slot for convenience.
该函数在 Qt 4.7 引入。
另请参阅 QInputMethod .
[signal]
void
QGraphicsObject::
visibleChanged
()
This signal gets emitted whenever the visibility of the item changes
注意: 通知程序信号对于特性 visible .
另请参阅 visible .
[signal]
void
QGraphicsObject::
xChanged
()
This signal gets emitted whenever the x position of the item changes
注意: 通知程序信号对于特性 x .
另请参阅 pos ().
[signal]
void
QGraphicsObject::
yChanged
()
This signal gets emitted whenever the y position of the item changes.
注意: 通知程序信号对于特性 y .
另请参阅 pos ().
[signal]
void
QGraphicsObject::
zChanged
()
This signal gets emitted whenever the z value of the item changes.
注意: 通知程序信号对于特性 z .
另请参阅 pos ().
[虚拟]
QGraphicsObject::
~QGraphicsObject
()
析构函数。
[override virtual protected]
bool
QGraphicsObject::
event
(
QEvent
*
ev
)
重实现: QObject::event (QEvent *e).
Subscribes the graphics object to the given gesture 采有特有 flags .
另请参阅 ungrabGesture () 和 QGestureEvent .
Unsubscribes the graphics object from the given gesture .
另请参阅 grabGesture () 和 QGestureEvent .