Movatterモバイル変換


[0]ホーム

URL:


We bake cookies in your browser for a better experience. Using this site means that you consent.Read More

Menu

Qt Documentation

QGraphicsObject Class

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

Properties

Public Functions

QGraphicsObject(QGraphicsItem * parent = 0)
voidgrabGesture(Qt::GestureType gesture, Qt::GestureFlags flags = Qt::GestureFlags())
voidungrabGesture(Qt::GestureType gesture)

Signals

Protected Slots

Additional Inherited Members

Detailed Description

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.

Parents and Children

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.

Property Documentation

effect :QGraphicsEffect * const

This property holds the effect attached to this item.

This property was introduced in Qt 4.7.

See alsoQGraphicsItem::setGraphicsEffect() andQGraphicsItem::graphicsEffect().

enabled : constbool

This property holds whether the item is enabled or not.

This property is declared inQGraphicsItem.

By default, this property is true.

Notifier signal:

voidenabledChanged()

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

opacity : constqreal

This property holds the opacity of the item.

Notifier signal:

voidopacityChanged()

See alsoQGraphicsItem::setOpacity() andQGraphicsItem::opacity().

parent :QGraphicsObject * const

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:

voidparentChanged()

See alsoQGraphicsItem::setParentItem() andQGraphicsItem::parentObject().

pos : constQPointF

This property holds the position of the item.

Describes the items position.

See alsoQGraphicsItem::setPos() andQGraphicsItem::pos().

rotation : constqreal

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:

voidrotationChanged()

scale : constqreal

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:

voidscaleChanged()

transformOriginPoint : constQPointF

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

visible : constbool

This property holds whether the item is visible or not.

This property is declared inQGraphicsItem.

By default, this property is true.

Notifier signal:

voidvisibleChanged()

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

x : constqreal

This property holds the x position of the item.

Describes the items x position.

Notifier signal:

voidxChanged()

See alsoQGraphicsItem::setX(),setPos(), and xChanged().

y : constqreal

This property holds the y position of the item.

Describes the items y position.

Notifier signal:

voidyChanged()

See alsoQGraphicsItem::setY(),setPos(), and yChanged().

z : constqreal

This property holds the z value of the item.

Describes the items z value.

Notifier signal:

voidzChanged()

See alsoQGraphicsItem::setZValue(),zValue(), and zChanged().

Member Function Documentation

QGraphicsObject::QGraphicsObject(QGraphicsItem * parent = 0)

Constructs aQGraphicsObject withparent.

void QGraphicsObject::grabGesture(Qt::GestureType gesture,Qt::GestureFlags flags = Qt::GestureFlags())

Subscribes the graphics object to the givengesture with specificflags.

See alsoungrabGesture() andQGestureEvent.

void QGraphicsObject::ungrabGesture(Qt::GestureType gesture)

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.


[8]ページ先頭

©2009-2025 Movatter.jp