Sophie

Sophie

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

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">
<!-- qmetaobject.cpp -->
<head>
  <title>Qt 4.6: QMetaProperty Class Reference</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<a name="//apple_ref/cpp/cl//QMetaProperty"></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">QMetaProperty Class Reference<br /><span class="small-subtitle">[<a href="qtcore.html">QtCore</a> module]</span>
</h1>
<p>The QMetaProperty class provides meta-data about a property. <a href="#details">More...</a></p>
<pre> #include &lt;QMetaProperty&gt;</pre><ul>
<li><a href="qmetaproperty-members.html">List of all members, including inherited members</a></li>
<li><a href="qmetaproperty-obsolete.html">Obsolete members</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">QMetaEnum </td><td class="memItemRight" valign="bottom"><b><a href="qmetaproperty.html#enumerator">enumerator</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qmetaproperty.html#hasNotifySignal">hasNotifySignal</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qmetaproperty.html#isConstant">isConstant</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qmetaproperty.html#isDesignable">isDesignable</a></b> ( const QObject * <i>object</i> = 0 ) const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qmetaproperty.html#isEnumType">isEnumType</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qmetaproperty.html#isFinal">isFinal</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qmetaproperty.html#isFlagType">isFlagType</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qmetaproperty.html#isReadable">isReadable</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qmetaproperty.html#isResettable">isResettable</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qmetaproperty.html#isScriptable">isScriptable</a></b> ( const QObject * <i>object</i> = 0 ) const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qmetaproperty.html#isStored">isStored</a></b> ( const QObject * <i>object</i> = 0 ) const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qmetaproperty.html#isUser">isUser</a></b> ( const QObject * <i>object</i> = 0 ) const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qmetaproperty.html#isValid">isValid</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qmetaproperty.html#isWritable">isWritable</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><b><a href="qmetaproperty.html#name">name</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QMetaMethod </td><td class="memItemRight" valign="bottom"><b><a href="qmetaproperty.html#notifySignal">notifySignal</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><b><a href="qmetaproperty.html#notifySignalIndex">notifySignalIndex</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><b><a href="qmetaproperty.html#propertyIndex">propertyIndex</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QVariant </td><td class="memItemRight" valign="bottom"><b><a href="qmetaproperty.html#read">read</a></b> ( const QObject * <i>object</i> ) const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qmetaproperty.html#reset">reset</a></b> ( QObject * <i>object</i> ) const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QVariant::Type </td><td class="memItemRight" valign="bottom"><b><a href="qmetaproperty.html#type">type</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><b><a href="qmetaproperty.html#typeName">typeName</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><b><a href="qmetaproperty.html#userType">userType</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qmetaproperty.html#write">write</a></b> ( QObject * <i>object</i>, const QVariant &amp; <i>value</i> ) const</td></tr>
</table>
<a name="details"></a>
<hr />
<h2>Detailed Description</h2>
<p>The QMetaProperty class provides meta-data about a property.</p>
<p>Property meta-data is obtained from 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>
<a name="property-meta-data"></a>
<h3>Property Meta-Data</h3>
<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>(), and <a href="qmetaproperty.html#isStored">isStored</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&#x2e; 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>
<a name="copying-and-assignment"></a>
<h3>Copying and Assignment</h3>
<p>QMetaProperty objects can be copied by value. However, each copy will refer to the same underlying property meta-data.</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>Member Function Documentation</h2>
<a name="//apple_ref/cpp/instm/QMetaProperty/enumerator"></a>
<h3 class="fn"><a name="enumerator"></a><a href="qmetaenum.html">QMetaEnum</a> QMetaProperty::enumerator () const</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>
<a name="//apple_ref/cpp/instm/QMetaProperty/hasNotifySignal"></a>
<h3 class="fn"><a name="hasNotifySignal"></a>bool QMetaProperty::hasNotifySignal () const</h3>
<p>Returns true if this property has a corresponding change notify signal; otherwise returns false.</p>
<p>See also <a href="qmetaproperty.html#notifySignal">notifySignal</a>().</p>
<a name="//apple_ref/cpp/instm/QMetaProperty/isConstant"></a>
<h3 class="fn"><a name="isConstant"></a>bool QMetaProperty::isConstant () const</h3>
<p>Returns true if the property is constant; otherwise returns false.</p>
<p>A property is constant if the <tt>Q_PROPERTY()</tt>'s <tt>CONSTANT</tt> attribute is set.</p>
<p>This function was introduced in Qt 4.6.</p>
<a name="//apple_ref/cpp/instm/QMetaProperty/isDesignable"></a>
<h3 class="fn"><a name="isDesignable"></a>bool QMetaProperty::isDesignable ( const <a href="qobject.html">QObject</a> * <i>object</i> = 0 ) const</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>() and <a href="qmetaproperty.html#isStored">isStored</a>().</p>
<a name="//apple_ref/cpp/instm/QMetaProperty/isEnumType"></a>
<h3 class="fn"><a name="isEnumType"></a>bool QMetaProperty::isEnumType () const</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>
<a name="//apple_ref/cpp/instm/QMetaProperty/isFinal"></a>
<h3 class="fn"><a name="isFinal"></a>bool QMetaProperty::isFinal () const</h3>
<p>Returns true if the property is final; otherwise returns false.</p>
<p>A property is final if the <tt>Q_PROPERTY()</tt>'s <tt>FINAL</tt> attribute is set.</p>
<p>This function was introduced in Qt 4.6.</p>
<a name="//apple_ref/cpp/instm/QMetaProperty/isFlagType"></a>
<h3 class="fn"><a name="isFlagType"></a>bool QMetaProperty::isFlagType () const</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>
<a name="//apple_ref/cpp/instm/QMetaProperty/isReadable"></a>
<h3 class="fn"><a name="isReadable"></a>bool QMetaProperty::isReadable () const</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>
<a name="//apple_ref/cpp/instm/QMetaProperty/isResettable"></a>
<h3 class="fn"><a name="isResettable"></a>bool QMetaProperty::isResettable () const</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>
<a name="//apple_ref/cpp/instm/QMetaProperty/isScriptable"></a>
<h3 class="fn"><a name="isScriptable"></a>bool QMetaProperty::isScriptable ( const <a href="qobject.html">QObject</a> * <i>object</i> = 0 ) const</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>SCRIPTABLE</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>() and <a href="qmetaproperty.html#isStored">isStored</a>().</p>
<a name="//apple_ref/cpp/instm/QMetaProperty/isStored"></a>
<h3 class="fn"><a name="isStored"></a>bool QMetaProperty::isStored ( const <a href="qobject.html">QObject</a> * <i>object</i> = 0 ) const</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>STORED</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>() and <a href="qmetaproperty.html#isScriptable">isScriptable</a>().</p>
<a name="//apple_ref/cpp/instm/QMetaProperty/isUser"></a>
<h3 class="fn"><a name="isUser"></a>bool QMetaProperty::isUser ( const <a href="qobject.html">QObject</a> * <i>object</i> = 0 ) const</h3>
<p>Returns true if this property is designated as the <tt>USER</tt> property, i.e&#x2e;, the one that the user can edit for <i>object</i> or that is significant in some other way. Otherwise it returns false. e.g&#x2e;, the <tt>text</tt> property is the <tt>USER</tt> editable property of a <a href="qlineedit.html">QLineEdit</a>.</p>
<p>If <i>object</i> is null, the function returns false if the <tt>Q_PROPERTY()</tt>'s <tt>USER</tt> attribute is false. Otherwise it returns true.</p>
<p>See also <a href="qmetaobject.html#userProperty">QMetaObject::userProperty</a>(), <a href="qmetaproperty.html#isDesignable">isDesignable</a>(), and <a href="qmetaproperty.html#isScriptable">isScriptable</a>().</p>
<a name="//apple_ref/cpp/instm/QMetaProperty/isValid"></a>
<h3 class="fn"><a name="isValid"></a>bool QMetaProperty::isValid () const</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>
<a name="//apple_ref/cpp/instm/QMetaProperty/isWritable"></a>
<h3 class="fn"><a name="isWritable"></a>bool QMetaProperty::isWritable () const</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>
<a name="//apple_ref/cpp/instm/QMetaProperty/name"></a>
<h3 class="fn"><a name="name"></a>const char * QMetaProperty::name () const</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>
<a name="//apple_ref/cpp/instm/QMetaProperty/notifySignal"></a>
<h3 class="fn"><a name="notifySignal"></a><a href="qmetamethod.html">QMetaMethod</a> QMetaProperty::notifySignal () const</h3>
<p>Returns the <a href="qmetamethod.html">QMetaMethod</a> instance of the property change notifying signal if one was specified, otherwise returns an invalid <a href="qmetamethod.html">QMetaMethod</a>.</p>
<p>This function was introduced in Qt 4.5.</p>
<p>See also <a href="qmetaproperty.html#hasNotifySignal">hasNotifySignal</a>().</p>
<a name="//apple_ref/cpp/instm/QMetaProperty/notifySignalIndex"></a>
<h3 class="fn"><a name="notifySignalIndex"></a>int QMetaProperty::notifySignalIndex () const</h3>
<p>Returns the index of the property change notifying signal if one was specified, otherwise returns -1.</p>
<p>This function was introduced in Qt 4.6.</p>
<p>See also <a href="qmetaproperty.html#hasNotifySignal">hasNotifySignal</a>().</p>
<a name="//apple_ref/cpp/instm/QMetaProperty/propertyIndex"></a>
<h3 class="fn"><a name="propertyIndex"></a>int QMetaProperty::propertyIndex () const</h3>
<p>Returns this property's index.</p>
<p>This function was introduced in Qt 4.6.</p>
<a name="//apple_ref/cpp/instm/QMetaProperty/read"></a>
<h3 class="fn"><a name="read"></a><a href="qvariant.html">QVariant</a> QMetaProperty::read ( const <a href="qobject.html">QObject</a> * <i>object</i> ) const</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>
<a name="//apple_ref/cpp/instm/QMetaProperty/reset"></a>
<h3 class="fn"><a name="reset"></a>bool QMetaProperty::reset ( <a href="qobject.html">QObject</a> * <i>object</i> ) const</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>
<a name="//apple_ref/cpp/instm/QMetaProperty/type"></a>
<h3 class="fn"><a name="type"></a><a href="qvariant.html#Type-enum">QVariant::Type</a> QMetaProperty::type () const</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#userType">userType</a>(), <a href="qmetaproperty.html#typeName">typeName</a>(), and <a href="qmetaproperty.html#name">name</a>().</p>
<a name="//apple_ref/cpp/instm/QMetaProperty/typeName"></a>
<h3 class="fn"><a name="typeName"></a>const char * QMetaProperty::typeName () const</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>
<a name="//apple_ref/cpp/instm/QMetaProperty/userType"></a>
<h3 class="fn"><a name="userType"></a>int QMetaProperty::userType () const</h3>
<p>Returns this property's user type. The return value is one of the values that are registered with <a href="qmetatype.html">QMetaType</a>, or 0 if the type is not registered.</p>
<p>This function was introduced in Qt 4.2.</p>
<p>See also <a href="qmetaproperty.html#type">type</a>(), <a href="qmetatype.html">QMetaType</a>, and <a href="qmetaproperty.html#typeName">typeName</a>().</p>
<a name="//apple_ref/cpp/instm/QMetaProperty/write"></a>
<h3 class="fn"><a name="write"></a>bool QMetaProperty::write ( <a href="qobject.html">QObject</a> * <i>object</i>, const <a href="qvariant.html">QVariant</a> &amp; <i>value</i> ) const</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>
<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>