
We bake cookies in your browser for a better experience. Using this site means that you consent.Read More
TheQGraphicsObject class provides a base class for all graphics items that require signals, slots and properties.More...
| Header: | #include <QGraphicsObject> |
| Since: | Qt 4.6 |
| Inherits: | QObject andQGraphicsItem |
| Inherited By: | QDeclarativeItem,QGraphicsSvgItem,QGraphicsTextItem, andQGraphicsWidget |
| 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() |
TheQGraphicsObject class provides a base class for all graphics items that require signals, slots and properties.
The class extends aQGraphicsItem 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.
Each graphics object can be constructed with a parent item. This ensures that the item will be destroyed when its parent item is destroyed. AlthoughQGraphicsObject 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 theparentItem() andchildItems() functions. In the hierarchy of items in a scene, theparentObject() andparentWidget() functions are the equivalent of theQWidget::parent() andQWidget::parentWidget() functions forQWidget subclasses.
See alsoQGraphicsWidget.
This property holds the effect attached to this item.
This property was introduced in Qt 4.7.
See alsoQGraphicsItem::setGraphicsEffect() andQGraphicsItem::graphicsEffect().
This property holds whether the item is enabled or not.
This property is declared inQGraphicsItem.
By default, this property is true.
Notifier signal:
| void | enabledChanged() |
See alsoQGraphicsItem::isEnabled(),QGraphicsItem::setEnabled(), and QGraphicsObject::enabledChanged().
This property holds the opacity of the item.
Notifier signal:
| void | opacityChanged() |
See alsoQGraphicsItem::setOpacity() andQGraphicsItem::opacity().
This property holds the parent of the item.
Note:The item's parent is set independently of the parent object returned byQObject::parent().
Notifier signal:
| void | parentChanged() |
See alsoQGraphicsItem::setParentItem() andQGraphicsItem::parentObject().
This property holds the position of the item.
Describes the items position.
See alsoQGraphicsItem::setPos() andQGraphicsItem::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).
Notifier signal:
| 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.
Notifier signal:
| 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.
See alsoscale,rotation, andQGraphicsItem::transformOriginPoint().
This property holds whether the item is visible or not.
This property is declared inQGraphicsItem.
By default, this property is true.
Notifier signal:
| void | visibleChanged() |
See alsoQGraphicsItem::isVisible(),QGraphicsItem::setVisible(), and visibleChanged().
This property holds the x position of the item.
Describes the items x position.
Notifier signal:
| void | xChanged() |
See alsoQGraphicsItem::setX(),setPos(), and xChanged().
This property holds the y position of the item.
Describes the items y position.
Notifier signal:
| void | yChanged() |
See alsoQGraphicsItem::setY(),setPos(), and yChanged().
This property holds the z value of the item.
Describes the items z value.
Notifier signal:
| void | zChanged() |
See alsoQGraphicsItem::setZValue(),zValue(), and zChanged().
Constructs aQGraphicsObject withparent.
Subscribes the graphics object to the givengesture with specificflags.
See alsoungrabGesture() andQGestureEvent.
Unsubscribes the graphics object from the givengesture.
See alsograbGesture() andQGestureEvent.
[protected slot]void QGraphicsObject::updateMicroFocus()Updates the item's micro focus. This is slot for convenience.
This function was introduced in Qt 4.7.
See alsoQInputContext.
© 2016 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 theGNU 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.