Qt 4.6: QGraphicsObject Class Reference

|  | Home · All Classes · Overviews |

# QGraphicsObject Class Reference
[QtGui module]

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

     #include <QGraphicsObject>

Inherits QObject and QGraphicsItem.

Inherited by QGraphicsTextItem and QGraphicsWidget.

This class was introduced in Qt 4.6.

- List of all members, including inherited members

## Properties

- enabled : const bool
- id : const QString
- opacity : const qreal
- parent : QGraphicsObject * const
- pos : const QPointF
- rotation : const qreal

- scale : const qreal
- transformOriginPoint : const QPointF
- visible : const bool
- x : const qreal
- y : const qreal
- z : const qreal

- 1 property inherited from QObject

## Public Functions

| QGraphicsObject ( QGraphicsItem * parent = 0 )

- 29 public functions inherited from QObject
- 173 public functions inherited from QGraphicsItem

## Signals

void | enabledChanged ()
void | opacityChanged ()
void | parentChanged ()
void | rotationChanged ()
void | scaleChanged ()
void | visibleChanged ()
void | xChanged ()
void | yChanged ()
void | zChanged ()

- 1 signal inherited from QObject

### Additional Inherited Members

- 1 public slot inherited from QObject
- 5 static public members inherited from QObject
- 1 static public member inherited from QGraphicsItem
- 7 protected functions inherited from QObject
- 23 protected functions inherited from QGraphicsItem

## Detailed Description

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

The class extends a 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.

## Property Documentation

### enabled : const bool

This property holds whether the item is enabled or not.

This property is declared in QGraphicsItem.

By default, this property is true.

Notifier signal:

void | enabledChanged ()

See also QGraphicsItem::isEnabled(), QGraphicsItem::setEnabled(), and QGraphicsObject::enabledChanged().

### id : const QString

This property holds the id of of the item.

See also QObject::objectName() and QObject::setObjectName().

### opacity : const qreal

This property holds the opacity of the item.

Notifier signal:

void | opacityChanged ()

See also QGraphicsItem::setOpacity() and QGraphicsItem::opacity().

### parent : QGraphicsObject * const

This property holds the parent of the item.

Notifier signal:

void | parentChanged ()

See also QGraphicsItem::setParentItem() and QGraphicsItem::parentObject().

### pos : const QPointF

This property holds the position of the item.

Describes the items position.

See also QGraphicsItem::setPos() and QGraphicsItem::pos().

### rotation : const qreal

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 ()

### scale : const qreal

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 ()

### transformOriginPoint : const QPointF

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 also scale, rotation, and QGraphicsItem::transformOriginPoint().

### visible : const bool

This property holds whether the item is visible or not.

This property is declared in QGraphicsItem.

By default, this property is true.

Notifier signal:

void | visibleChanged ()

See also QGraphicsItem::isVisible(), QGraphicsItem::setVisible(), and visibleChanged().

### x : const qreal

This property holds the x position of the item.

Describes the items x position.

Notifier signal:

void | xChanged ()

See also QGraphicsItem::setX(), setPos(), and xChanged().

### y : const qreal

This property holds the y position of the item.

Describes the items y position.

Notifier signal:

void | yChanged ()

See also QGraphicsItem::setY(), setPos(), and yChanged().

### z : const qreal

This property holds the z value of the item.

Describes the items z value.

Notifier signal:

void | zChanged ()

See also QGraphicsItem::setZValue(), zValue(), and zChanged().

## Member Function Documentation

### QGraphicsObject::QGraphicsObject ( QGraphicsItem * parent = 0 )

Constructs a QGraphicsObject with parent.

### void QGraphicsObject::enabledChanged () `[signal]`

This signal gets emitted whenever the item get's enabled or disabled.

See also isEnabled().

### void QGraphicsObject::opacityChanged () `[signal]`

This signal gets emitted whenever the opacity of the item changes

See also QGraphicsItem::opacity().

### void QGraphicsObject::parentChanged () `[signal]`

This signal gets emitted whenever the parent of the item changes

### void QGraphicsObject::rotationChanged () `[signal]`

This signal gets emitted whenever the roation of the item changes.

### void QGraphicsObject::scaleChanged () `[signal]`

This signal is emitted when the scale of the item changes.

### void QGraphicsObject::visibleChanged () `[signal]`

This signal gets emitted whenever the visibility of the item changes

See also visible.

### void QGraphicsObject::xChanged () `[signal]`

This signal gets emitted whenever the x position of the item changes

See also pos().

### void QGraphicsObject::yChanged () `[signal]`

This signal gets emitted whenever the y position of the item changes.

See also pos().

### void QGraphicsObject::zChanged () `[signal]`

This signal gets emitted whenever the z value of the item changes.

See also pos().