Sophie

Sophie

distrib > Mandriva > current > i586 > media > main-updates > by-pkgid > 8e6051afcdb111a0317a58fb64c2abf5 > files > 4179

qt4-doc-4.6.3-0.2mdv2010.2.i586.rpm

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- qgraphicsitem.cpp -->
<head>
  <title>Qt 4.6: QGraphicsObject Class Reference</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<a name="//apple_ref/cpp/cl//QGraphicsObject"></a>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://qt.nokia.com/"><img src="images/qt-logo.png" align="left" border="0" /></a></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">All&nbsp;Functions</font></a>&nbsp;&middot; <a href="overviews.html"><font color="#004faf">Overviews</font></a></td></tr></table><h1 class="title">QGraphicsObject Class Reference<br /><span class="small-subtitle">[<a href="qtgui.html">QtGui</a> module]</span>
</h1>
<p>The QGraphicsObject class provides a base class for all graphics items that require signals, slots and properties. <a href="#details">More...</a></p>
<pre> #include &lt;QGraphicsObject&gt;</pre><p>Inherits <a href="qobject.html">QObject</a> and <a href="qgraphicsitem.html">QGraphicsItem</a>.</p>
<p>Inherited by <a href="qgraphicssvgitem.html">QGraphicsSvgItem</a>, <a href="qgraphicstextitem.html">QGraphicsTextItem</a>, and <a href="qgraphicswidget.html">QGraphicsWidget</a>.</p>
<p>This class was introduced in Qt 4.6.</p>
<ul>
<li><a href="qgraphicsobject-members.html">List of all members, including inherited members</a></li>
</ul>
<hr />
<a name="properties"></a>
<h2>Properties</h2>
<p><table class="propsummary" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td width="45%" valign="top"><ul>
<li><div class="fn"><b><a href="qgraphicsobject.html#enabled-prop">enabled</a></b> : const bool</div></li>
<li><div class="fn"><b><a href="qgraphicsobject.html#opacity-prop">opacity</a></b> : const qreal</div></li>
<li><div class="fn"><b><a href="qgraphicsobject.html#parent-prop">parent</a></b> : QGraphicsObject * const</div></li>
<li><div class="fn"><b><a href="qgraphicsobject.html#pos-prop">pos</a></b> : const QPointF</div></li>
<li><div class="fn"><b><a href="qgraphicsobject.html#rotation-prop">rotation</a></b> : const qreal</div></li>
<li><div class="fn"><b><a href="qgraphicsobject.html#scale-prop">scale</a></b> : const qreal</div></li>
</ul></td><td valign="top"><ul>
<li><div class="fn"><b><a href="qgraphicsobject.html#transformOriginPoint-prop">transformOriginPoint</a></b> : const QPointF</div></li>
<li><div class="fn"><b><a href="qgraphicsobject.html#visible-prop">visible</a></b> : const bool</div></li>
<li><div class="fn"><b><a href="qgraphicsobject.html#x-prop">x</a></b> : const qreal</div></li>
<li><div class="fn"><b><a href="qgraphicsobject.html#y-prop">y</a></b> : const qreal</div></li>
<li><div class="fn"><b><a href="qgraphicsobject.html#z-prop">z</a></b> : const qreal</div></li>
</ul>
</td></tr>
</table></p>
<ul>
<li><div bar="2" class="fn"></div>1 property inherited from <a href="qobject.html#properties">QObject</a></li>
</ul>
<hr />
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsobject.html#QGraphicsObject">QGraphicsObject</a></b> ( QGraphicsItem * <i>parent</i> = 0 )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsobject.html#grabGesture">grabGesture</a></b> ( Qt::GestureType <i>gesture</i>, Qt::GestureFlags <i>flags</i> = Qt::GestureFlags() )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsobject.html#ungrabGesture">ungrabGesture</a></b> ( Qt::GestureType <i>gesture</i> )</td></tr>
</table>
<ul>
<li><div bar="2" class="fn"></div>29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
<li><div bar="2" class="fn"></div>177 public functions inherited from <a href="qgraphicsitem.html#public-functions">QGraphicsItem</a></li>
</ul>
<hr />
<a name="signals"></a>
<h2>Signals</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsobject.html#enabledChanged">enabledChanged</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsobject.html#opacityChanged">opacityChanged</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsobject.html#parentChanged">parentChanged</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsobject.html#rotationChanged">rotationChanged</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsobject.html#scaleChanged">scaleChanged</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsobject.html#visibleChanged">visibleChanged</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsobject.html#xChanged">xChanged</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsobject.html#yChanged">yChanged</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsobject.html#zChanged">zChanged</a></b> ()</td></tr>
</table>
<ul>
<li><div bar="2" class="fn"></div>1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li><div class="fn"></div>1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
<li><div class="fn"></div>5 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
<li><div class="fn"></div>2 static public members inherited from <a href="qgraphicsitem.html#static-public-members">QGraphicsItem</a></li>
<li><div class="fn"></div>7 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
<li><div class="fn"></div>23 protected functions inherited from <a href="qgraphicsitem.html#protected-functions">QGraphicsItem</a></li>
</ul>
<a name="details"></a>
<hr />
<h2>Detailed Description</h2>
<p>The QGraphicsObject class provides a base class for all graphics items that require signals, slots and properties.</p>
<p>The class extends a <a href="qgraphicsitem.html">QGraphicsItem</a> with <a href="qobject.html">QObject</a>'s signal/slot and property mechanisms. It maps many of <a href="qgraphicsitem.html">QGraphicsItem</a>'s basic setters and getters to properties and adds notification signals for many of them.</p>
<a name="parents-and-children"></a>
<h3>Parents and Children</h3>
<p>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 <a href="qobject.html">QObject</a> and <a href="qgraphicsitem.html">QGraphicsItem</a>, you should use the functions provided by <a href="qgraphicsitem.html">QGraphicsItem</a>, <i>not</i> <a href="qobject.html">QObject</a>, to manage the relationships between parent and child items.</p>
<p>The relationships between items can be explored using the <a href="qgraphicsitem.html#parentItem">parentItem</a>() and <a href="qgraphicsitem.html#childItems">childItems</a>() functions. In the hierarchy of items in a scene, the <a href="qgraphicsitem.html#parentObject">parentObject</a>() and <a href="qgraphicsitem.html#parentWidget">parentWidget</a>() functions are the equivalent of the <a href="qobject.html#parent">QWidget::parent</a>() and <a href="qwidget.html#parentWidget">QWidget::parentWidget</a>() functions for <a href="qwidget.html">QWidget</a> subclasses.</p>
<p>See also <a href="qgraphicswidget.html">QGraphicsWidget</a>.</p>
<hr />
<h2>Property Documentation</h2>
<a name="//apple_ref/cpp/instm/QGraphicsObject/enabledChanged"></a>
<h3 class="fn"><a name="enabled-prop"></a>enabled : const bool</h3>
<p>This property holds whether the item is enabled or not.</p>
<p>This property is declared in <a href="qgraphicsitem.html">QGraphicsItem</a>.</p>
<p>By default, this property is true.</p>
<p><b>Notifier signal:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsobject.html#enabledChanged">enabledChanged</a></b> ()</td></tr>
</table>
<p>See also <a href="qgraphicsitem.html#isEnabled">QGraphicsItem::isEnabled</a>(), <a href="qgraphicsitem.html#setEnabled">QGraphicsItem::setEnabled</a>(), and <a href="qgraphicsobject.html#enabledChanged">QGraphicsObject::enabledChanged</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsObject/opacityChanged"></a>
<h3 class="fn"><a name="opacity-prop"></a>opacity : const <a href="qtglobal.html#qreal-typedef">qreal</a></h3>
<p>This property holds the opacity of the item.</p>
<p><b>Notifier signal:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsobject.html#opacityChanged">opacityChanged</a></b> ()</td></tr>
</table>
<p>See also <a href="qgraphicsitem.html#setOpacity">QGraphicsItem::setOpacity</a>() and <a href="qgraphicsitem.html#opacity">QGraphicsItem::opacity</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsObject/parentChanged"></a>
<h3 class="fn"><a name="parent-prop"></a>parent : QGraphicsObject * const</h3>
<p>This property holds the parent of the item.</p>
<p><b>Note:</b> The item's parent is set independently of the parent object returned by <a href="qobject.html#parent">QObject::parent</a>().</p>
<p><b>Notifier signal:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsobject.html#parentChanged">parentChanged</a></b> ()</td></tr>
</table>
<p>See also <a href="qgraphicsitem.html#setParentItem">QGraphicsItem::setParentItem</a>() and <a href="qgraphicsitem.html#parentObject">QGraphicsItem::parentObject</a>().</p>
<h3 class="fn"><a name="pos-prop"></a>pos : const <a href="qpointf.html">QPointF</a></h3>
<p>This property holds the position of the item.</p>
<p>Describes the items position.</p>
<p>See also <a href="qgraphicsitem.html#setPos">QGraphicsItem::setPos</a>() and <a href="qgraphicsitem.html#pos">QGraphicsItem::pos</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsObject/rotationChanged"></a>
<h3 class="fn"><a name="rotation-prop"></a>rotation : const <a href="qtglobal.html#qreal-typedef">qreal</a></h3>
<p>This property holds the rotation of the item in degrees.</p>
<p>This specifies how many degrees to rotate the item around its transformOrigin. The default rotation is 0 degrees (i.e&#x2e; not rotated at all).</p>
<p><b>Notifier signal:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsobject.html#rotationChanged">rotationChanged</a></b> ()</td></tr>
</table>
<a name="//apple_ref/cpp/instm/QGraphicsObject/scaleChanged"></a>
<h3 class="fn"><a name="scale-prop"></a>scale : const <a href="qtglobal.html#qreal-typedef">qreal</a></h3>
<p>This property holds the scale of the item.</p>
<p>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.</p>
<p>By default, items are displayed at a scale of 1 (i.e&#x2e; at their normal size).</p>
<p>Scaling is from the item's transformOrigin.</p>
<p><b>Notifier signal:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsobject.html#scaleChanged">scaleChanged</a></b> ()</td></tr>
</table>
<h3 class="fn"><a name="transformOriginPoint-prop"></a>transformOriginPoint : const <a href="qpointf.html">QPointF</a></h3>
<p>This property holds the transformation origin.</p>
<p>This property sets a specific point in the items coordiante system as the origin for scale and rotation.</p>
<p>See also <a href="qgraphicsobject.html#scale-prop">scale</a>, <a href="qgraphicsobject.html#rotation-prop">rotation</a>, and <a href="qgraphicsitem.html#transformOriginPoint">QGraphicsItem::transformOriginPoint</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsObject/visibleChanged"></a>
<h3 class="fn"><a name="visible-prop"></a>visible : const bool</h3>
<p>This property holds whether the item is visible or not.</p>
<p>This property is declared in <a href="qgraphicsitem.html">QGraphicsItem</a>.</p>
<p>By default, this property is true.</p>
<p><b>Notifier signal:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsobject.html#visibleChanged">visibleChanged</a></b> ()</td></tr>
</table>
<p>See also <a href="qgraphicsitem.html#isVisible">QGraphicsItem::isVisible</a>(), <a href="qgraphicsitem.html#setVisible">QGraphicsItem::setVisible</a>(), and <a href="qgraphicsobject.html#visibleChanged">visibleChanged</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsObject/xChanged"></a>
<h3 class="fn"><a name="x-prop"></a>x : const <a href="qtglobal.html#qreal-typedef">qreal</a></h3>
<p>This property holds the x position of the item.</p>
<p>Describes the items x position.</p>
<p><b>Notifier signal:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsobject.html#xChanged">xChanged</a></b> ()</td></tr>
</table>
<p>See also <a href="qgraphicsitem.html#setX">QGraphicsItem::setX</a>(), <a href="qgraphicsitem.html#setPos">setPos</a>(), and <a href="qgraphicsobject.html#xChanged">xChanged</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsObject/yChanged"></a>
<h3 class="fn"><a name="y-prop"></a>y : const <a href="qtglobal.html#qreal-typedef">qreal</a></h3>
<p>This property holds the y position of the item.</p>
<p>Describes the items y position.</p>
<p><b>Notifier signal:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsobject.html#yChanged">yChanged</a></b> ()</td></tr>
</table>
<p>See also <a href="qgraphicsitem.html#setY">QGraphicsItem::setY</a>(), <a href="qgraphicsitem.html#setPos">setPos</a>(), and <a href="qgraphicsobject.html#yChanged">yChanged</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsObject/zChanged"></a>
<h3 class="fn"><a name="z-prop"></a>z : const <a href="qtglobal.html#qreal-typedef">qreal</a></h3>
<p>This property holds the z value of the item.</p>
<p>Describes the items z value.</p>
<p><b>Notifier signal:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsobject.html#zChanged">zChanged</a></b> ()</td></tr>
</table>
<p>See also <a href="qgraphicsitem.html#setZValue">QGraphicsItem::setZValue</a>(), <a href="qgraphicsitem.html#zValue">zValue</a>(), and <a href="qgraphicsobject.html#zChanged">zChanged</a>().</p>
<hr />
<h2>Member Function Documentation</h2>
<a name="//apple_ref/cpp/instm/QGraphicsObject/QGraphicsObject"></a>
<h3 class="fn"><a name="QGraphicsObject"></a>QGraphicsObject::QGraphicsObject ( <a href="qgraphicsitem.html">QGraphicsItem</a> * <i>parent</i> = 0 )</h3>
<p>Constructs a <a href="qgraphicsobject.html">QGraphicsObject</a> with <i>parent</i>.</p>
<a name="//apple_ref/cpp/instm/QGraphicsObject/enabledChanged"></a>
<h3 class="fn"><a name="enabledChanged"></a>void QGraphicsObject::enabledChanged ()&nbsp;&nbsp;<tt> [signal]</tt></h3>
<p>This signal gets emitted whenever the item get's enabled or disabled.</p>
<p>See also <a href="qgraphicsitem.html#isEnabled">isEnabled</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsObject/grabGesture"></a>
<h3 class="fn"><a name="grabGesture"></a>void QGraphicsObject::grabGesture ( <a href="qt.html#GestureType-enum">Qt::GestureType</a> <i>gesture</i>, <a href="qt.html#GestureFlag-enum">Qt::GestureFlags</a> <i>flags</i> = Qt::GestureFlags() )</h3>
<p>Subscribes the graphics object to the given <i>gesture</i> with specific <i>flags</i>.</p>
<p>See also <a href="qgraphicsobject.html#ungrabGesture">ungrabGesture</a>() and <a href="qgestureevent.html">QGestureEvent</a>.</p>
<a name="//apple_ref/cpp/instm/QGraphicsObject/opacityChanged"></a>
<h3 class="fn"><a name="opacityChanged"></a>void QGraphicsObject::opacityChanged ()&nbsp;&nbsp;<tt> [signal]</tt></h3>
<p>This signal gets emitted whenever the opacity of the item changes</p>
<p>See also <a href="qgraphicsitem.html#opacity">QGraphicsItem::opacity</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsObject/parentChanged"></a>
<h3 class="fn"><a name="parentChanged"></a>void QGraphicsObject::parentChanged ()&nbsp;&nbsp;<tt> [signal]</tt></h3>
<p>This signal gets emitted whenever the parent of the item changes</p>
<a name="//apple_ref/cpp/instm/QGraphicsObject/rotationChanged"></a>
<h3 class="fn"><a name="rotationChanged"></a>void QGraphicsObject::rotationChanged ()&nbsp;&nbsp;<tt> [signal]</tt></h3>
<p>This signal gets emitted whenever the roation of the item changes.</p>
<a name="//apple_ref/cpp/instm/QGraphicsObject/scaleChanged"></a>
<h3 class="fn"><a name="scaleChanged"></a>void QGraphicsObject::scaleChanged ()&nbsp;&nbsp;<tt> [signal]</tt></h3>
<p>This signal is emitted when the scale of the item changes.</p>
<a name="//apple_ref/cpp/instm/QGraphicsObject/ungrabGesture"></a>
<h3 class="fn"><a name="ungrabGesture"></a>void QGraphicsObject::ungrabGesture ( <a href="qt.html#GestureType-enum">Qt::GestureType</a> <i>gesture</i> )</h3>
<p>Unsubscribes the graphics object from the given <i>gesture</i>.</p>
<p>See also <a href="qgraphicsobject.html#grabGesture">grabGesture</a>() and <a href="qgestureevent.html">QGestureEvent</a>.</p>
<a name="//apple_ref/cpp/instm/QGraphicsObject/visibleChanged"></a>
<h3 class="fn"><a name="visibleChanged"></a>void QGraphicsObject::visibleChanged ()&nbsp;&nbsp;<tt> [signal]</tt></h3>
<p>This signal gets emitted whenever the visibility of the item changes</p>
<p>See also <a href="qgraphicsobject.html#visible-prop">visible</a>.</p>
<a name="//apple_ref/cpp/instm/QGraphicsObject/xChanged"></a>
<h3 class="fn"><a name="xChanged"></a>void QGraphicsObject::xChanged ()&nbsp;&nbsp;<tt> [signal]</tt></h3>
<p>This signal gets emitted whenever the x position of the item changes</p>
<p>See also <a href="qgraphicsitem.html#pos">pos</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsObject/yChanged"></a>
<h3 class="fn"><a name="yChanged"></a>void QGraphicsObject::yChanged ()&nbsp;&nbsp;<tt> [signal]</tt></h3>
<p>This signal gets emitted whenever the y position of the item changes.</p>
<p>See also <a href="qgraphicsitem.html#pos">pos</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsObject/zChanged"></a>
<h3 class="fn"><a name="zChanged"></a>void QGraphicsObject::zChanged ()&nbsp;&nbsp;<tt> [signal]</tt></h3>
<p>This signal gets emitted whenever the z value of the item changes.</p>
<p>See also <a href="qgraphicsitem.html#pos">pos</a>().</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="40%" align="left">Copyright &copy; 2010 Nokia Corporation and/or its subsidiary(-ies)</td>
<td width="20%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="40%" align="right"><div align="right">Qt 4.6.3</div></td>
</tr></table></div></address></body>
</html>