The QGraphicsObject 类为要求信号、槽及特性的所有图形项提供基类。 更多...
| 头: | #include <QGraphicsObject> |
| Since: | Qt 4.6 |
| 继承: | QObject and QGraphicsItem |
| 继承者: | QDeclarativeItem , QGraphicsSvgItem , QGraphicsTextItem ,和 QGraphicsWidget |
| QGraphicsObject (QGraphicsItem * parent = 0) | |
| 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 () |
| void | updateMicroFocus () |
The QGraphicsObject 类为要求信号、槽及特性的所有图形项提供基类。
类延伸 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 .
This property holds the effect attached to this item.
该特性在 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 (), and QGraphicsObject::enabledChanged().
This property holds the opacity of the item.
通知程序信号:
| 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 ().
This property holds the position of the item.
另请参阅 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 items coordiante 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 (), and visibleChanged().
This property holds the x position of the item.
Describes the items x position.
通知程序信号:
| void | xChanged () |
另请参阅 QGraphicsItem::setX (), setPos (), and xChanged().
This property holds the y position of the item.
Describes the items y position.
通知程序信号:
| void | yChanged () |
另请参阅 QGraphicsItem::setY (), setPos (), and yChanged().
This property holds the z value of the item.
Describes the items z value.
通知程序信号:
| void | zChanged () |
另请参阅 QGraphicsItem::setZValue (), zValue (), and zChanged().
构造 QGraphicsObject with parent .
Subscribes the graphics object to the given gesture 采有特有 flags .
另请参阅 ungrabGesture () 和 QGestureEvent .
Unsubscribes the graphics object from the given gesture .
另请参阅 grabGesture () 和 QGestureEvent .
[protected slot]
void
QGraphicsObject::
updateMicroFocus
()
Updates the item's micro focus. This is slot for convenience.
该函数在 Qt 4.7 引入。
另请参阅 QInputContext .