1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140
|
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QDeclarativeItem Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">  </td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QDeclarativeItem Class Reference<br /><sup><sup>[<a href="qtdeclarative.html">QtDeclarative</a> module]</sup></sup></h1><p>The QDeclarativeItem class provides the most basic of all visual
items in QML. <a href="#details">More...</a></p>
<p>Inherits <a href="qgraphicsobject.html">QGraphicsObject</a> and <a href="qdeclarativeparserstatus.html">QDeclarativeParserStatus</a>.</p><h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qdeclarativeitem.html#TransformOrigin-enum">TransformOrigin</a></b> { TopLeft, Top, TopRight, Left, ..., BottomRight }</li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qdeclarativeitem.html#QDeclarativeItem">__init__</a></b> (<i>self</i>, QDeclarativeItem <i>parent</i> = None)</li><li><div class="fn" />float <b><a href="qdeclarativeitem.html#baselineOffset">baselineOffset</a></b> (<i>self</i>)</li><li><div class="fn" />QRectF <b><a href="qdeclarativeitem.html#boundingRect">boundingRect</a></b> (<i>self</i>)</li><li><div class="fn" />QRectF <b><a href="qdeclarativeitem.html#childrenRect">childrenRect</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qdeclarativeitem.html#classBegin">classBegin</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qdeclarativeitem.html#clip">clip</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qdeclarativeitem.html#componentComplete">componentComplete</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qdeclarativeitem.html#event">event</a></b> (<i>self</i>, QEvent)</li><li><div class="fn" /><b><a href="qdeclarativeitem.html#geometryChanged">geometryChanged</a></b> (<i>self</i>, QRectF <i>newGeometry</i>, QRectF <i>oldGeometry</i>)</li><li><div class="fn" />bool <b><a href="qdeclarativeitem.html#hasFocus">hasFocus</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qdeclarativeitem.html#heightValid">heightValid</a></b> (<i>self</i>)</li><li><div class="fn" />float <b><a href="qdeclarativeitem.html#implicitHeight">implicitHeight</a></b> (<i>self</i>)</li><li><div class="fn" />float <b><a href="qdeclarativeitem.html#implicitWidth">implicitWidth</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qdeclarativeitem.html#inputMethodEvent">inputMethodEvent</a></b> (<i>self</i>, QInputMethodEvent)</li><li><div class="fn" />QVariant <b><a href="qdeclarativeitem.html#inputMethodQuery">inputMethodQuery</a></b> (<i>self</i>, Qt.InputMethodQuery <i>query</i>)</li><li><div class="fn" />bool <b><a href="qdeclarativeitem.html#isComponentComplete">isComponentComplete</a></b> (<i>self</i>)</li><li><div class="fn" />QVariant <b><a href="qdeclarativeitem.html#itemChange">itemChange</a></b> (<i>self</i>, QGraphicsItem.GraphicsItemChange, QVariant)</li><li><div class="fn" />bool <b><a href="qdeclarativeitem.html#keepMouseGrab">keepMouseGrab</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qdeclarativeitem.html#keyPressEvent">keyPressEvent</a></b> (<i>self</i>, QKeyEvent <i>event</i>)</li><li><div class="fn" /><b><a href="qdeclarativeitem.html#keyReleaseEvent">keyReleaseEvent</a></b> (<i>self</i>, QKeyEvent <i>event</i>)</li><li><div class="fn" /><b><a href="qdeclarativeitem.html#paint">paint</a></b> (<i>self</i>, QPainter, QStyleOptionGraphicsItem, QWidget)</li><li><div class="fn" />QDeclarativeItem <b><a href="qdeclarativeitem.html#parentItem">parentItem</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qdeclarativeitem.html#sceneEvent">sceneEvent</a></b> (<i>self</i>, QEvent)</li><li><div class="fn" /><b><a href="qdeclarativeitem.html#setBaselineOffset">setBaselineOffset</a></b> (<i>self</i>, float)</li><li><div class="fn" /><b><a href="qdeclarativeitem.html#setClip">setClip</a></b> (<i>self</i>, bool)</li><li><div class="fn" /><b><a href="qdeclarativeitem.html#setHeight">setHeight</a></b> (<i>self</i>, float)</li><li><div class="fn" /><b><a href="qdeclarativeitem.html#setImplicitHeight">setImplicitHeight</a></b> (<i>self</i>, float)</li><li><div class="fn" /><b><a href="qdeclarativeitem.html#setImplicitWidth">setImplicitWidth</a></b> (<i>self</i>, float)</li><li><div class="fn" /><b><a href="qdeclarativeitem.html#setKeepMouseGrab">setKeepMouseGrab</a></b> (<i>self</i>, bool)</li><li><div class="fn" /><b><a href="qdeclarativeitem.html#setParentItem">setParentItem</a></b> (<i>self</i>, QDeclarativeItem <i>parent</i>)</li><li><div class="fn" /><b><a href="qdeclarativeitem.html#setSmooth">setSmooth</a></b> (<i>self</i>, bool)</li><li><div class="fn" /><b><a href="qdeclarativeitem.html#setTransformOrigin">setTransformOrigin</a></b> (<i>self</i>, TransformOrigin)</li><li><div class="fn" /><b><a href="qdeclarativeitem.html#setWidth">setWidth</a></b> (<i>self</i>, float)</li><li><div class="fn" />bool <b><a href="qdeclarativeitem.html#smooth">smooth</a></b> (<i>self</i>)</li><li><div class="fn" />TransformOrigin <b><a href="qdeclarativeitem.html#transformOrigin">transformOrigin</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qdeclarativeitem.html#widthValid">widthValid</a></b> (<i>self</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QDeclarativeItem class provides the most basic of all visual
items in QML.</p>
<p>All visual items in Qt Declarative inherit from
QDeclarativeItem. Although QDeclarativeItem has no visual
appearance, it defines all the properties that are common across
visual items - such as the x and y position, the width and height,
<a href="qml-anchor-layout.html#anchor-layout">anchoring</a> and
key handling.</p>
<p>You can subclass QDeclarativeItem to provide your own custom
visual item that inherits these features. Note that, because it
does not draw anything, QDeclarativeItem sets the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">QGraphicsItem.ItemHasNoContents</a>
flag. If you subclass QDeclarativeItem to create a visual item, you
will need to unset this flag.</p>
<hr /><h2>Type Documentation</h2><h3 class="fn"><a name="TransformOrigin-enum" />QDeclarativeItem.TransformOrigin</h3><p>Controls the point about which simple transforms like scale
apply.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QDeclarativeItem.TopLeft</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">The top-left corner of the item.</td>
</tr>
<tr>
<td class="topAlign"><tt>QDeclarativeItem.Top</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">The center point of the top of the item.</td>
</tr>
<tr>
<td class="topAlign"><tt>QDeclarativeItem.TopRight</tt></td>
<td class="topAlign"><tt>2</tt></td>
<td class="topAlign">The top-right corner of the item.</td>
</tr>
<tr>
<td class="topAlign"><tt>QDeclarativeItem.Left</tt></td>
<td class="topAlign"><tt>3</tt></td>
<td class="topAlign">The left most point of the vertical
middle.</td>
</tr>
<tr>
<td class="topAlign"><tt>QDeclarativeItem.Center</tt></td>
<td class="topAlign"><tt>4</tt></td>
<td class="topAlign">The center of the item.</td>
</tr>
<tr>
<td class="topAlign"><tt>QDeclarativeItem.Right</tt></td>
<td class="topAlign"><tt>5</tt></td>
<td class="topAlign">The right most point of the vertical
middle.</td>
</tr>
<tr>
<td class="topAlign"><tt>QDeclarativeItem.BottomLeft</tt></td>
<td class="topAlign"><tt>6</tt></td>
<td class="topAlign">The bottom-left corner of the item.</td>
</tr>
<tr>
<td class="topAlign"><tt>QDeclarativeItem.Bottom</tt></td>
<td class="topAlign"><tt>7</tt></td>
<td class="topAlign">The center point of the bottom of the
item.</td>
</tr>
<tr>
<td class="topAlign"><tt>QDeclarativeItem.BottomRight</tt></td>
<td class="topAlign"><tt>8</tt></td>
<td class="topAlign">The bottom-right corner of the item.</td>
</tr>
</table>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QDeclarativeItem" />QDeclarativeItem.__init__ (<i>self</i>, <a href="qdeclarativeitem.html">QDeclarativeItem</a> <i>parent</i> = None)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs a <a href="qdeclarativeitem.html">QDeclarativeItem</a> with the given
<i>parent</i>.</p>
<h3 class="fn"><a name="baselineOffset" />float QDeclarativeItem.baselineOffset (<i>self</i>)</h3><h3 class="fn"><a name="boundingRect" /><a href="qrectf.html">QRectF</a> QDeclarativeItem.boundingRect (<i>self</i>)</h3><h3 class="fn"><a name="childrenRect" /><a href="qrectf.html">QRectF</a> QDeclarativeItem.childrenRect (<i>self</i>)</h3><h3 class="fn"><a name="classBegin" />QDeclarativeItem.classBegin (<i>self</i>)</h3><h3 class="fn"><a name="clip" />bool QDeclarativeItem.clip (<i>self</i>)</h3><h3 class="fn"><a name="componentComplete" />QDeclarativeItem.componentComplete (<i>self</i>)</h3><h3 class="fn"><a name="event" />bool QDeclarativeItem.event (<i>self</i>, <a href="qevent.html">QEvent</a>)</h3><h3 class="fn"><a name="geometryChanged" />QDeclarativeItem.geometryChanged (<i>self</i>, <a href="qrectf.html">QRectF</a> <i>newGeometry</i>, <a href="qrectf.html">QRectF</a> <i>oldGeometry</i>)</h3><p>This function is called to handle this item's changes in
geometry from <i>oldGeometry</i> to <i>newGeometry</i>. If the two
geometries are the same, it doesn't do anything.</p>
<h3 class="fn"><a name="hasFocus" />bool QDeclarativeItem.hasFocus (<i>self</i>)</h3><h3 class="fn"><a name="heightValid" />bool QDeclarativeItem.heightValid (<i>self</i>)</h3><p>Returns whether the height property has been set explicitly.</p>
<h3 class="fn"><a name="implicitHeight" />float QDeclarativeItem.implicitHeight (<i>self</i>)</h3><h3 class="fn"><a name="implicitWidth" />float QDeclarativeItem.implicitWidth (<i>self</i>)</h3><h3 class="fn"><a name="inputMethodEvent" />QDeclarativeItem.inputMethodEvent (<i>self</i>, <a href="qinputmethodevent.html">QInputMethodEvent</a>)</h3><h3 class="fn"><a name="inputMethodQuery" />QVariant QDeclarativeItem.inputMethodQuery (<i>self</i>, <a href="qt.html#InputMethodQuery-enum">Qt.InputMethodQuery</a> <i>query</i>)</h3><h3 class="fn"><a name="isComponentComplete" />bool QDeclarativeItem.isComponentComplete (<i>self</i>)</h3><p>Returns true if construction of the QML component is complete;
otherwise returns false.</p>
<p>It is often desirable to delay some processing until the
component is completed.</p>
<p><b>See also</b> <a href="qdeclarativeparserstatus.html#componentComplete">componentComplete</a>().</p>
<h3 class="fn"><a name="itemChange" />QVariant QDeclarativeItem.itemChange (<i>self</i>, <a href="qgraphicsitem.html#GraphicsItemChange-enum">QGraphicsItem.GraphicsItemChange</a>, QVariant)</h3><h3 class="fn"><a name="keepMouseGrab" />bool QDeclarativeItem.keepMouseGrab (<i>self</i>)</h3><p>Returns a value indicating whether mouse input should remain
with this item exclusively.</p>
<p><b>See also</b> <a href="qdeclarativeitem.html#setKeepMouseGrab">setKeepMouseGrab</a>().</p>
<h3 class="fn"><a name="keyPressEvent" />QDeclarativeItem.keyPressEvent (<i>self</i>, <a href="qkeyevent.html">QKeyEvent</a> <i>event</i>)</h3><h3 class="fn"><a name="keyReleaseEvent" />QDeclarativeItem.keyReleaseEvent (<i>self</i>, <a href="qkeyevent.html">QKeyEvent</a> <i>event</i>)</h3><h3 class="fn"><a name="paint" />QDeclarativeItem.paint (<i>self</i>, <a href="qpainter.html">QPainter</a>, <a href="qstyleoptiongraphicsitem.html">QStyleOptionGraphicsItem</a>, <a href="qwidget.html">QWidget</a>)</h3><h3 class="fn"><a name="parentItem" /><a href="qdeclarativeitem.html">QDeclarativeItem</a> QDeclarativeItem.parentItem (<i>self</i>)</h3><h3 class="fn"><a name="sceneEvent" />bool QDeclarativeItem.sceneEvent (<i>self</i>, <a href="qevent.html">QEvent</a>)</h3><h3 class="fn"><a name="setBaselineOffset" />QDeclarativeItem.setBaselineOffset (<i>self</i>, float)</h3><h3 class="fn"><a name="setClip" />QDeclarativeItem.setClip (<i>self</i>, bool)</h3><h3 class="fn"><a name="setHeight" />QDeclarativeItem.setHeight (<i>self</i>, float)</h3><h3 class="fn"><a name="setImplicitHeight" />QDeclarativeItem.setImplicitHeight (<i>self</i>, float)</h3><p>Sets the implied height of the item to <i>h</i>. This is the
height implied by other properties that determine the content.</p>
<p><b>See also</b> <a href="qdeclarativeitem.html#implicitHeight-prop">implicitHeight</a>().</p>
<h3 class="fn"><a name="setImplicitWidth" />QDeclarativeItem.setImplicitWidth (<i>self</i>, float)</h3><p>Sets the implied width of the item to <i>w</i>. This is the
width implied by other properties that determine the content.</p>
<p><b>See also</b> <a href="qdeclarativeitem.html#implicitWidth-prop">implicitWidth</a>().</p>
<h3 class="fn"><a name="setKeepMouseGrab" />QDeclarativeItem.setKeepMouseGrab (<i>self</i>, bool)</h3><p>The flag indicating whether the mouse should remain with this
item is set to <i>keep</i>.</p>
<p>This is useful for items that wish to grab and keep mouse
interaction following a predefined gesture. For example, an item
that is interested in horizontal mouse movement may set
keepMouseGrab to true once a threshold has been exceeded. Once
keepMouseGrab has been set to true, filtering items will not react
to mouse events.</p>
<p>If the item does not indicate that it wishes to retain mouse
grab, a filtering item may steal the grab. For example, Flickable
may attempt to steal a mouse grab if it detects that the user has
begun to move the viewport.</p>
<p><b>See also</b> <a href="qdeclarativeitem.html#keepMouseGrab">keepMouseGrab</a>().</p>
<h3 class="fn"><a name="setParentItem" />QDeclarativeItem.setParentItem (<i>self</i>, <a href="qdeclarativeitem.html">QDeclarativeItem</a> <i>parent</i>)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><h3 class="fn"><a name="setSmooth" />QDeclarativeItem.setSmooth (<i>self</i>, bool)</h3><h3 class="fn"><a name="setTransformOrigin" />QDeclarativeItem.setTransformOrigin (<i>self</i>, <a href="qdeclarativeitem.html#TransformOrigin-enum">TransformOrigin</a>)</h3><p>Set the transform <i>origin</i>.</p>
<p><b>See also</b> <a href="qdeclarativeitem.html#transformOrigin">transformOrigin</a>().</p>
<h3 class="fn"><a name="setWidth" />QDeclarativeItem.setWidth (<i>self</i>, float)</h3><h3 class="fn"><a name="smooth" />bool QDeclarativeItem.smooth (<i>self</i>)</h3><h3 class="fn"><a name="transformOrigin" /><a href="qdeclarativeitem.html#TransformOrigin-enum">TransformOrigin</a> QDeclarativeItem.transformOrigin (<i>self</i>)</h3><p>Returns the current transform origin.</p>
<p><b>See also</b> <a href="qdeclarativeitem.html#setTransformOrigin">setTransformOrigin</a>().</p>
<h3 class="fn"><a name="widthValid" />bool QDeclarativeItem.widthValid (<i>self</i>)</h3><p>Returns whether the width property has been set explicitly.</p>
<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt 4.9.3 for X11</td><td align="center" width="50%">Copyright © <a href="http://www.riverbankcomputing.com">Riverbank Computing Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2012</td><td align="right" width="25%">Qt 4.8.2</td></tr></table></div></address></body></html>
|