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
|
<?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>QMetaProperty 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="../pyqt4ref.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">QMetaProperty Class Reference<br /><sup><sup>[<a href="qtcore.html">QtCore</a> module]</sup></sup></h1><p>The QMetaProperty class provides meta-data about a property. <a href="#details">More...</a></p>
<h3>Methods</h3><ul><li><div class="fn" /><b><a href="qmetaproperty.html#QMetaProperty">__init__</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qmetaproperty.html#QMetaProperty-2">__init__</a></b> (<i>self</i>, QMetaProperty)</li><li><div class="fn" />QMetaEnum <b><a href="qmetaproperty.html#enumerator">enumerator</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qmetaproperty.html#hasStdCppSet">hasStdCppSet</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qmetaproperty.html#isDesignable">isDesignable</a></b> (<i>self</i>, QObject <i>obj</i> = None)</li><li><div class="fn" />bool <b><a href="qmetaproperty.html#isEditable">isEditable</a></b> (<i>self</i>, QObject <i>obj</i> = None)</li><li><div class="fn" />bool <b><a href="qmetaproperty.html#isEnumType">isEnumType</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qmetaproperty.html#isFlagType">isFlagType</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qmetaproperty.html#isReadable">isReadable</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qmetaproperty.html#isResettable">isResettable</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qmetaproperty.html#isScriptable">isScriptable</a></b> (<i>self</i>, QObject <i>obj</i> = None)</li><li><div class="fn" />bool <b><a href="qmetaproperty.html#isStored">isStored</a></b> (<i>self</i>, QObject <i>obj</i> = None)</li><li><div class="fn" />bool <b><a href="qmetaproperty.html#isUser">isUser</a></b> (<i>self</i>, QObject <i>obj</i> = None)</li><li><div class="fn" />bool <b><a href="qmetaproperty.html#isValid">isValid</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qmetaproperty.html#isWritable">isWritable</a></b> (<i>self</i>)</li><li><div class="fn" />str <b><a href="qmetaproperty.html#name">name</a></b> (<i>self</i>)</li><li><div class="fn" />QVariant <b><a href="qmetaproperty.html#read">read</a></b> (<i>self</i>, QObject <i>obj</i>)</li><li><div class="fn" />bool <b><a href="qmetaproperty.html#reset">reset</a></b> (<i>self</i>, QObject <i>obj</i>)</li><li><div class="fn" />QVariant.Type <b><a href="qmetaproperty.html#type">type</a></b> (<i>self</i>)</li><li><div class="fn" />str <b><a href="qmetaproperty.html#typeName">typeName</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qmetaproperty.html#write">write</a></b> (<i>self</i>, QObject <i>obj</i>, QVariant <i>value</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QMetaProperty class provides meta-data about a property.</p>
<p>A property has a <a href="qmetaproperty.html#name">name</a>() and a <a href="qmetaproperty.html#type">type</a>(), as well as various attributes that specify its behavior: <a href="qmetaproperty.html#isReadable">isReadable</a>(), <a href="qmetaproperty.html#isWritable">isWritable</a>(), <a href="qmetaproperty.html#isDesignable">isDesignable</a>(), <a href="qmetaproperty.html#isScriptable">isScriptable</a>(), <a href="qmetaproperty.html#isStored">isStored</a>(), and <a href="qmetaproperty.html#isEditable">isEditable</a>().</p>
<p>If the property is an enumeration, <a href="qmetaproperty.html#isEnumType">isEnumType</a>() returns true; if the property is an enumeration that is also a flag (i.e. its values can be combined using the OR operator), <a href="qmetaproperty.html#isEnumType">isEnumType</a>() and <a href="qmetaproperty.html#isFlagType">isFlagType</a>() both return true. The enumerator for these types is available from <a href="qmetaproperty.html#enumerator">enumerator</a>().</p>
<p>The property's values are set and retrieved with <a href="qmetaproperty.html#read">read</a>(), <a href="qmetaproperty.html#write">write</a>(), and <a href="qmetaproperty.html#reset">reset</a>(); they can also be changed through <a href="qobject.html">QObject</a>'s set and get functions. See <a href="qobject.html#setProperty">QObject.setProperty</a>() and <a href="qobject.html#property">QObject.property</a>() for details.</p>
<p>You get property meta-data through an object's meta-object. See <a href="qmetaobject.html#property">QMetaObject.property</a>() and <a href="qmetaobject.html#propertyCount">QMetaObject.propertyCount</a>() for details.</p>
<p>See also <a href="qmetaobject.html">QMetaObject</a>, <a href="qmetaenum.html">QMetaEnum</a>, <a href="qmetamethod.html">QMetaMethod</a>, and <a href="properties.html">Qt's Property System</a>.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QMetaProperty" />QMetaProperty.__init__ (<i>self</i>)</h3><h3 class="fn"><a name="QMetaProperty-2" />QMetaProperty.__init__ (<i>self</i>, <a href="qmetaproperty.html">QMetaProperty</a>)</h3><h3 class="fn"><a name="enumerator" /><a href="qmetaenum.html">QMetaEnum</a> QMetaProperty.enumerator (<i>self</i>)</h3><p>Returns the enumerator if this property's type is an enumerator type; otherwise the returned value is undefined.</p>
<p>See also <a href="qmetaproperty.html#isEnumType">isEnumType</a>() and <a href="qmetaproperty.html#isFlagType">isFlagType</a>().</p>
<h3 class="fn"><a name="hasStdCppSet" />bool QMetaProperty.hasStdCppSet (<i>self</i>)</h3><h3 class="fn"><a name="isDesignable" />bool QMetaProperty.isDesignable (<i>self</i>, <a href="qobject.html">QObject</a> <i>obj</i> = None)</h3><p>Returns true if this property is designable for the given <i>object</i>; otherwise returns false.</p>
<p>If no <i>object</i> is given, the function returns false if the <tt>Q_PROPERTY()</tt>'s <tt>DESIGNABLE</tt> attribute is false; otherwise returns true (if the attribute is true or is a function or expression).</p>
<p>See also <a href="qmetaproperty.html#isScriptable">isScriptable</a>(), <a href="qmetaproperty.html#isStored">isStored</a>(), and <a href="qmetaproperty.html#isEditable">isEditable</a>().</p>
<h3 class="fn"><a name="isEditable" />bool QMetaProperty.isEditable (<i>self</i>, <a href="qobject.html">QObject</a> <i>obj</i> = None)</h3><p>Returns true if the property is editable for the given <i>object</i>; otherwise returns false.</p>
<p>If no <i>object</i> is given, the function returns false if the <tt>Q_PROPERTY()</tt>'s <tt>DESIGNABLE</tt> attribute is false; otherwise returns true (if the attribute is true or is a function or expression).</p>
<p>See also <a href="qmetaproperty.html#isDesignable">isDesignable</a>(), <a href="qmetaproperty.html#isScriptable">isScriptable</a>(), and <a href="qmetaproperty.html#isStored">isStored</a>().</p>
<h3 class="fn"><a name="isEnumType" />bool QMetaProperty.isEnumType (<i>self</i>)</h3><p>Returns true if the property's type is an enumeration value; otherwise returns false.</p>
<p>See also <a href="qmetaproperty.html#enumerator">enumerator</a>() and <a href="qmetaproperty.html#isFlagType">isFlagType</a>().</p>
<h3 class="fn"><a name="isFlagType" />bool QMetaProperty.isFlagType (<i>self</i>)</h3><p>Returns true if the property's type is an enumeration value that is used as a flag; otherwise returns false.</p>
<p>Flags can be combined using the OR operator. A flag type is implicitly also an enum type.</p>
<p>See also <a href="qmetaproperty.html#isEnumType">isEnumType</a>(), <a href="qmetaproperty.html#enumerator">enumerator</a>(), and <a href="qmetaenum.html#isFlag">QMetaEnum.isFlag</a>().</p>
<h3 class="fn"><a name="isReadable" />bool QMetaProperty.isReadable (<i>self</i>)</h3><p>Returns true if this property is readable; otherwise returns false.</p>
<p>See also <a href="qmetaproperty.html#isWritable">isWritable</a>(), <a href="qmetaproperty.html#read">read</a>(), and <a href="qmetaproperty.html#isValid">isValid</a>().</p>
<h3 class="fn"><a name="isResettable" />bool QMetaProperty.isResettable (<i>self</i>)</h3><p>Returns true if this property can be reset to a default value; otherwise returns false.</p>
<p>See also <a href="qmetaproperty.html#reset">reset</a>().</p>
<h3 class="fn"><a name="isScriptable" />bool QMetaProperty.isScriptable (<i>self</i>, <a href="qobject.html">QObject</a> <i>obj</i> = None)</h3><p>Returns true if the property is scriptable for the given <i>object</i>; otherwise returns false.</p>
<p>If no <i>object</i> is given, the function returns false if the <tt>Q_PROPERTY()</tt>'s <tt>DESIGNABLE</tt> attribute is false; otherwise returns true (if the attribute is true or is a function or expression).</p>
<p>See also <a href="qmetaproperty.html#isDesignable">isDesignable</a>(), <a href="qmetaproperty.html#isStored">isStored</a>(), and <a href="qmetaproperty.html#isEditable">isEditable</a>().</p>
<h3 class="fn"><a name="isStored" />bool QMetaProperty.isStored (<i>self</i>, <a href="qobject.html">QObject</a> <i>obj</i> = None)</h3><p>Returns true if the property is stored for <i>object</i>; otherwise returns false.</p>
<p>If no <i>object</i> is given, the function returns false if the <tt>Q_PROPERTY()</tt>'s <tt>DESIGNABLE</tt> attribute is false; otherwise returns true (if the attribute is true or is a function or expression).</p>
<p>See also <a href="qmetaproperty.html#isDesignable">isDesignable</a>(), <a href="qmetaproperty.html#isScriptable">isScriptable</a>(), and <a href="qmetaproperty.html#isEditable">isEditable</a>().</p>
<h3 class="fn"><a name="isUser" />bool QMetaProperty.isUser (<i>self</i>, <a href="qobject.html">QObject</a> <i>obj</i> = None)</h3><p>Returns true if this is the property that the user can editable for <i>object</i>; otherwise returns false. I.e. the text property is the user editable property of a <a href="qlineedit.html">QLineEdit</a>.</p>
<p>If no <i>object</i> is given, the function returns false if the <tt>Q_PROPERTY()</tt>'s <tt>USER</tt> attribute is false; otherwise returns true (if the attribute is true or is a function or expression).</p>
<p>See also <a href="qmetaproperty.html#isDesignable">isDesignable</a>(), <a href="qmetaproperty.html#isScriptable">isScriptable</a>(), and <a href="qmetaproperty.html#isEditable">isEditable</a>().</p>
<h3 class="fn"><a name="isValid" />bool QMetaProperty.isValid (<i>self</i>)</h3><p>Returns true if this property is valid (readable); otherwise returns false.</p>
<p>See also <a href="qmetaproperty.html#isReadable">isReadable</a>().</p>
<h3 class="fn"><a name="isWritable" />bool QMetaProperty.isWritable (<i>self</i>)</h3><p>Returns true if this property is writable; otherwise returns false.</p>
<p>See also <a href="qmetaproperty.html#isReadable">isReadable</a>() and <a href="qmetaproperty.html#write">write</a>().</p>
<h3 class="fn"><a name="name" />str QMetaProperty.name (<i>self</i>)</h3><p>Returns this property's name.</p>
<p>See also <a href="qmetaproperty.html#type">type</a>() and <a href="qmetaproperty.html#typeName">typeName</a>().</p>
<h3 class="fn"><a name="read" /><a href="qvariant.html">QVariant</a> QMetaProperty.read (<i>self</i>, <a href="qobject.html">QObject</a> <i>obj</i>)</h3><p>Reads the property's value from the given <i>object</i>. Returns the value if it was able to read it; otherwise returns an invalid variant.</p>
<p>See also <a href="qmetaproperty.html#write">write</a>(), <a href="qmetaproperty.html#reset">reset</a>(), and <a href="qmetaproperty.html#isReadable">isReadable</a>().</p>
<h3 class="fn"><a name="reset" />bool QMetaProperty.reset (<i>self</i>, <a href="qobject.html">QObject</a> <i>obj</i>)</h3><p>Resets the property for the given <i>object</i> with a reset method. Returns true if the reset worked; otherwise returns false.</p>
<p>Reset methods are optional; only a few properties support them.</p>
<p>See also <a href="qmetaproperty.html#read">read</a>() and <a href="qmetaproperty.html#write">write</a>().</p>
<h3 class="fn"><a name="type" /><a href="qvariant.html#Type-enum">QVariant.Type</a> QMetaProperty.type (<i>self</i>)</h3><p>Returns this property's type. The return value is one of the values of the <a href="qvariant.html#Type-enum">QVariant.Type</a> enumeration.</p>
<p>See also <a href="qmetaproperty.html#typeName">typeName</a>() and <a href="qmetaproperty.html#name">name</a>().</p>
<h3 class="fn"><a name="typeName" />str QMetaProperty.typeName (<i>self</i>)</h3><p>Returns the name of this property's type.</p>
<p>See also <a href="qmetaproperty.html#type">type</a>() and <a href="qmetaproperty.html#name">name</a>().</p>
<h3 class="fn"><a name="write" />bool QMetaProperty.write (<i>self</i>, <a href="qobject.html">QObject</a> <i>obj</i>, <a href="qvariant.html">QVariant</a> <i>value</i>)</h3><p>Writes <i>value</i> as the property's value to the given <i>object</i>. Returns true if the write succeeded; otherwise returns false.</p>
<p>See also <a href="qmetaproperty.html#read">read</a>(), <a href="qmetaproperty.html#reset">reset</a>(), and <a href="qmetaproperty.html#isWritable">isWritable</a>().</p>
<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td width="25%">PyQt 4.0.1 for X11</td><td align="center" width="50%">Copyright © <a href="http://www.riverbankcomputing.com">Riverbank Computing Ltd</a> and <a href="http://www.trolltech.com">Trolltech AS</a> 2006</td><td align="right" width="25%">Qt 4.1.4</td></tr></table></div></address></body></html>
|