<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- qdeclarativeproperty.cpp --> <title>Qt 4.8: QDeclarativeProperty Class Reference</title> <link rel="stylesheet" type="text/css" href="style/style.css" /> <script src="scripts/jquery.js" type="text/javascript"></script> <script src="scripts/functions.js" type="text/javascript"></script> <link rel="stylesheet" type="text/css" href="style/superfish.css" /> <link rel="stylesheet" type="text/css" href="style/narrow.css" /> <!--[if IE]> <meta name="MSSmartTagsPreventParsing" content="true"> <meta http-equiv="imagetoolbar" content="no"> <![endif]--> <!--[if lt IE 7]> <link rel="stylesheet" type="text/css" href="style/style_ie6.css"> <![endif]--> <!--[if IE 7]> <link rel="stylesheet" type="text/css" href="style/style_ie7.css"> <![endif]--> <!--[if IE 8]> <link rel="stylesheet" type="text/css" href="style/style_ie8.css"> <![endif]--> <script src="scripts/superfish.js" type="text/javascript"></script> <script src="scripts/narrow.js" type="text/javascript"></script> </head> <body class="" onload="CheckEmptyAndLoadList();"> <div class="header" id="qtdocheader"> <div class="content"> <div id="nav-logo"> <a href="index.html">Home</a></div> <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a> <div id="narrowsearch"></div> <div id="nav-topright"> <ul> <li class="nav-topright-home"><a href="http://qt.digia.com/">Qt HOME</a></li> <li class="nav-topright-dev"><a href="http://qt-project.org/">DEV</a></li> <li class="nav-topright-doc nav-topright-doc-active"><a href="http://qt-project.org/doc/"> DOC</a></li> <li class="nav-topright-blog"><a href="http://blog.qt.digia.com/">BLOG</a></li> </ul> </div> <div id="shortCut"> <ul> <li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.8</a></span></li> <li class="shortCut-topleft-active"><a href="http://qt-project.org/doc/">ALL VERSIONS </a></li> </ul> </div> <ul class="sf-menu" id="narrowmenu"> <li><a href="#">API Lookup</a> <ul> <li><a href="classes.html">Class index</a></li> <li><a href="functions.html">Function index</a></li> <li><a href="modules.html">Modules</a></li> <li><a href="namespaces.html">Namespaces</a></li> <li><a href="qtglobal.html">Global Declarations</a></li> <li><a href="qdeclarativeelements.html">QML elements</a></li> </ul> </li> <li><a href="#">Qt Topics</a> <ul> <li><a href="qt-basic-concepts.html">Programming with Qt</a></li> <li><a href="qtquick.html">Device UIs & Qt Quick</a></li> <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li> <li><a href="supported-platforms.html">Supported Platforms</a></li> <li><a href="technology-apis.html">Qt and Key Technologies</a></li> <li><a href="best-practices.html">How-To's and Best Practices</a></li> </ul> </li> <li><a href="#">Examples</a> <ul> <li><a href="all-examples.html">Examples</a></li> <li><a href="tutorials.html">Tutorials</a></li> <li><a href="demos.html">Demos</a></li> <li><a href="qdeclarativeexamples.html">QML Examples</a></li> </ul> </li> </ul> </div> </div> <div class="wrapper"> <div class="hd"> <span></span> </div> <div class="bd group"> <div class="sidebar"> <div class="searchlabel"> Search index:</div> <div class="search" id="sidebarsearch"> <form id="qtdocsearch" action="" onsubmit="return false;"> <fieldset> <input type="text" name="searchstring" id="pageType" value="" /> <div id="resultdialog"> <a href="#" id="resultclose">Close</a> <p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p> <p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span> results:</p> <ul id="resultlist" class="all"> </ul> </div> </fieldset> </form> </div> <div class="box first bottombar" id="lookup"> <h2 title="API Lookup"><span></span> API Lookup</h2> <div id="list001" class="list"> <ul id="ul001" > <li class="defaultLink"><a href="classes.html">Class index</a></li> <li class="defaultLink"><a href="functions.html">Function index</a></li> <li class="defaultLink"><a href="modules.html">Modules</a></li> <li class="defaultLink"><a href="namespaces.html">Namespaces</a></li> <li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li> <li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li> </ul> </div> </div> <div class="box bottombar" id="topics"> <h2 title="Qt Topics"><span></span> Qt Topics</h2> <div id="list002" class="list"> <ul id="ul002" > <li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li> <li class="defaultLink"><a href="qtquick.html">Device UIs & Qt Quick</a></li> <li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li> <li class="defaultLink"><a href="supported-platforms.html">Supported Platforms</a></li> <li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li> <li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li> </ul> </div> </div> <div class="box" id="examples"> <h2 title="Examples"><span></span> Examples</h2> <div id="list003" class="list"> <ul id="ul003"> <li class="defaultLink"><a href="all-examples.html">Examples</a></li> <li class="defaultLink"><a href="tutorials.html">Tutorials</a></li> <li class="defaultLink"><a href="demos.html">Demos</a></li> <li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li> </ul> </div> </div> </div> <div class="wrap"> <div class="toolbar"> <div class="breadcrumb toolblock"> <ul> <li class="first"><a href="index.html">Home</a></li> <!-- Breadcrumbs go here --> <li><a href="modules.html">Modules</a></li> <li><a href="qtdeclarative.html">QtDeclarative</a></li> <li>QDeclarativeProperty</li> </ul> </div> <div class="toolbuttons toolblock"> <ul> <li id="smallA" class="t_button">A</li> <li id="medA" class="t_button active">A</li> <li id="bigA" class="t_button">A</li> <li id="print" class="t_button"><a href="javascript:this.print();"> <span>Print</span></a></li> </ul> </div> </div> <div class="content mainContent"> <div class="toc"> <h3><a name="toc">Contents</a></h3> <ul> <li class="level1"><a href="#public-types">Public Types</a></li> <li class="level1"><a href="#public-functions">Public Functions</a></li> <li class="level1"><a href="#static-public-members">Static Public Members</a></li> <li class="level1"><a href="#details">Detailed Description</a></li> </ul> </div> <h1 class="title">QDeclarativeProperty Class Reference</h1> <!-- $$$QDeclarativeProperty-brief --> <p>The QDeclarativeProperty class abstracts accessing properties on objects created from QML. <a href="#details">More...</a></p> <!-- @@@QDeclarativeProperty --> <pre class="cpp"> <span class="preprocessor">#include <QDeclarativeProperty></span></pre><p>This class was introduced in Qt 4.7.</p> <ul> <li><a href="qdeclarativeproperty-members.html">List of all members, including inherited members</a></li> </ul> <a name="public-types"></a> <h2>Public Types</h2> <table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeproperty.html#PropertyTypeCategory-enum">PropertyTypeCategory</a></b> { InvalidCategory, List, Object, Normal }</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeproperty.html#Type-enum">Type</a></b> { Invalid, Property, SignalProperty }</td></tr> </table> <a name="public-functions"></a> <h2>Public Functions</h2> <table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeproperty.html#QDeclarativeProperty">QDeclarativeProperty</a></b> ()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeproperty.html#QDeclarativeProperty-2">QDeclarativeProperty</a></b> ( QObject * <i>obj</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeproperty.html#QDeclarativeProperty-3">QDeclarativeProperty</a></b> ( QObject * <i>obj</i>, QDeclarativeContext * <i>ctxt</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeproperty.html#QDeclarativeProperty-4">QDeclarativeProperty</a></b> ( QObject * <i>obj</i>, QDeclarativeEngine * <i>engine</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeproperty.html#QDeclarativeProperty-5">QDeclarativeProperty</a></b> ( QObject * <i>obj</i>, const QString & <i>name</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeproperty.html#QDeclarativeProperty-6">QDeclarativeProperty</a></b> ( QObject * <i>obj</i>, const QString & <i>name</i>, QDeclarativeContext * <i>ctxt</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeproperty.html#QDeclarativeProperty-7">QDeclarativeProperty</a></b> ( QObject * <i>obj</i>, const QString & <i>name</i>, QDeclarativeEngine * <i>engine</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeproperty.html#QDeclarativeProperty-8">QDeclarativeProperty</a></b> ( const QDeclarativeProperty & <i>other</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeproperty.html#connectNotifySignal">connectNotifySignal</a></b> ( QObject * <i>dest</i>, const char * <i>slot</i> ) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeproperty.html#connectNotifySignal-2">connectNotifySignal</a></b> ( QObject * <i>dest</i>, int <i>method</i> ) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeproperty.html#hasNotifySignal">hasNotifySignal</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeproperty.html#index">index</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeproperty.html#isDesignable">isDesignable</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeproperty.html#isProperty">isProperty</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeproperty.html#isResettable">isResettable</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeproperty.html#isSignalProperty">isSignalProperty</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeproperty.html#isValid">isValid</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeproperty.html#isWritable">isWritable</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QMetaMethod </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeproperty.html#method">method</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeproperty.html#name">name</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeproperty.html#needsNotifySignal">needsNotifySignal</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QObject * </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeproperty.html#object">object</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QMetaProperty </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeproperty.html#property">property</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeproperty.html#propertyType">propertyType</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> PropertyTypeCategory </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeproperty.html#propertyTypeCategory">propertyTypeCategory</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> const char * </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeproperty.html#propertyTypeName">propertyTypeName</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QVariant </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeproperty.html#read">read</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeproperty.html#reset">reset</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> Type </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeproperty.html#type">type</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeproperty.html#write">write</a></b> ( const QVariant & <i>value</i> ) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QDeclarativeProperty & </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeproperty.html#operator-eq">operator=</a></b> ( const QDeclarativeProperty & <i>other</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeproperty.html#operator-eq-eq">operator==</a></b> ( const QDeclarativeProperty & <i>other</i> ) const</td></tr> </table> <a name="static-public-members"></a> <h2>Static Public Members</h2> <table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> QVariant </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeproperty.html#read-2">read</a></b> ( QObject * <i>object</i>, const QString & <i>name</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QVariant </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeproperty.html#read-3">read</a></b> ( QObject * <i>object</i>, const QString & <i>name</i>, QDeclarativeContext * <i>ctxt</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QVariant </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeproperty.html#read-4">read</a></b> ( QObject * <i>object</i>, const QString & <i>name</i>, QDeclarativeEngine * <i>engine</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeproperty.html#write-2">write</a></b> ( QObject * <i>object</i>, const QString & <i>name</i>, const QVariant & <i>value</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeproperty.html#write-3">write</a></b> ( QObject * <i>object</i>, const QString & <i>name</i>, const QVariant & <i>value</i>, QDeclarativeContext * <i>ctxt</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeproperty.html#write-4">write</a></b> ( QObject * <i>object</i>, const QString & <i>name</i>, const QVariant & <i>value</i>, QDeclarativeEngine * <i>engine</i> )</td></tr> </table> <a name="details"></a> <!-- $$$QDeclarativeProperty-description --> <div class="descr"> <h2>Detailed Description</h2> <p>The QDeclarativeProperty class abstracts accessing properties on objects created from QML.</p> <p>As QML uses Qt's meta-type system all of the existing <a href="qmetaobject.html">QMetaObject</a> classes can be used to introspect and interact with objects created by QML. However, some of the new features provided by QML - such as type safety and attached properties - are most easily used through the QDeclarativeProperty class that simplifies some of their natural complexity.</p> <p>Unlike <a href="qmetaproperty.html">QMetaProperty</a> which represents a property on a class type, QDeclarativeProperty encapsulates a property on a specific object instance. To read a property's value, programmers create a QDeclarativeProperty instance and call the <a href="qdeclarativeproperty.html#read">read</a>() method. Likewise to write a property value the <a href="qdeclarativeproperty.html#write">write</a>() method is used.</p> <p>For example, for the following QML code:</p> <pre class="qml"> <span class="comment">// MyItem.qml</span> import QtQuick 1.0 <span class="type"><a href="qml-text.html">Text</a></span> { <span class="name">text</span>: <span class="string">"A bit of text"</span> }</pre> <p>The <a href="qml-text.html">Text</a> object's properties could be accessed using QDeclarativeProperty, like this:</p> <pre class="cpp"> <span class="preprocessor">#include <QDeclarativeProperty></span> <span class="preprocessor">#include <QGraphicsObject></span> <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span> <span class="type"><a href="qdeclarativeview.html">QDeclarativeView</a></span> view(<span class="type"><a href="qurl.html">QUrl</a></span><span class="operator">::</span>fromLocalFile(<span class="string">"MyItem.qml"</span>)); <span class="type">QDeclarativeProperty</span> <a href="qdeclarativeproperty.html#property">property</a>(view<span class="operator">.</span>rootObject()<span class="operator">,</span> <span class="string">"font.pixelSize"</span>); <a href="qtglobal.html#qWarning">qWarning</a>() <span class="operator"><</span><span class="operator"><</span> <span class="string">"Current pixel size:"</span> <span class="operator"><</span><span class="operator"><</span> property<span class="operator">.</span><a href="qdeclarativeproperty.html#read">read</a>()<span class="operator">.</span>toInt(); property<span class="operator">.</span><a href="qdeclarativeproperty.html#write">write</a>(<span class="number">24</span>); <a href="qtglobal.html#qWarning">qWarning</a>() <span class="operator"><</span><span class="operator"><</span> <span class="string">"Pixel size should now be 24:"</span> <span class="operator"><</span><span class="operator"><</span> property<span class="operator">.</span><a href="qdeclarativeproperty.html#read">read</a>()<span class="operator">.</span>toInt();</pre> </div> <!-- @@@QDeclarativeProperty --> <div class="types"> <h2>Member Type Documentation</h2> <!-- $$$PropertyTypeCategory$$$InvalidCategory$$$List$$$Object$$$Normal --> <h3 class="fn"><a name="PropertyTypeCategory-enum"></a>enum QDeclarativeProperty::<span class="name">PropertyTypeCategory</span></h3> <p>This enum specifies a category of QML property.</p> <table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr> <tr><td class="topAlign"><tt>QDeclarativeProperty::InvalidCategory</tt></td><td class="topAlign"><tt>0</tt></td><td class="topAlign">The property is invalid, or is a signal property.</td></tr> <tr><td class="topAlign"><tt>QDeclarativeProperty::List</tt></td><td class="topAlign"><tt>1</tt></td><td class="topAlign">The property is a <a href="qdeclarativelistproperty.html">QDeclarativeListProperty</a> list property</td></tr> <tr><td class="topAlign"><tt>QDeclarativeProperty::Object</tt></td><td class="topAlign"><tt>2</tt></td><td class="topAlign">The property is a <a href="qobject.html">QObject</a> derived type pointer</td></tr> <tr><td class="topAlign"><tt>QDeclarativeProperty::Normal</tt></td><td class="topAlign"><tt>3</tt></td><td class="topAlign">The property is a normal value property.</td></tr> </table> <!-- @@@PropertyTypeCategory --> <!-- $$$Type$$$Invalid$$$Property$$$SignalProperty --> <h3 class="fn"><a name="Type-enum"></a>enum QDeclarativeProperty::<span class="name">Type</span></h3> <p>This enum specifies a type of QML property.</p> <table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr> <tr><td class="topAlign"><tt>QDeclarativeProperty::Invalid</tt></td><td class="topAlign"><tt>0</tt></td><td class="topAlign">The property is invalid.</td></tr> <tr><td class="topAlign"><tt>QDeclarativeProperty::Property</tt></td><td class="topAlign"><tt>1</tt></td><td class="topAlign">The property is a regular Qt property.</td></tr> <tr><td class="topAlign"><tt>QDeclarativeProperty::SignalProperty</tt></td><td class="topAlign"><tt>2</tt></td><td class="topAlign">The property is a signal property.</td></tr> </table> <!-- @@@Type --> </div> <div class="func"> <h2>Member Function Documentation</h2> <!-- $$$QDeclarativeProperty[overload1]$$$QDeclarativeProperty --> <h3 class="fn"><a name="QDeclarativeProperty"></a>QDeclarativeProperty::<span class="name">QDeclarativeProperty</span> ()</h3> <p>Create an invalid <a href="qdeclarativeproperty.html">QDeclarativeProperty</a>.</p> <!-- @@@QDeclarativeProperty --> <!-- $$$QDeclarativeProperty$$$QDeclarativePropertyQObject* --> <h3 class="fn"><a name="QDeclarativeProperty-2"></a>QDeclarativeProperty::<span class="name">QDeclarativeProperty</span> ( <span class="type"><a href="qobject.html">QObject</a></span> * <i>obj</i> )</h3> <p>Creates a <a href="qdeclarativeproperty.html">QDeclarativeProperty</a> for the default property of <i>obj</i>. If there is no default property, an invalid <a href="qdeclarativeproperty.html">QDeclarativeProperty</a> will be created.</p> <!-- @@@QDeclarativeProperty --> <!-- $$$QDeclarativeProperty$$$QDeclarativePropertyQObject*QDeclarativeContext* --> <h3 class="fn"><a name="QDeclarativeProperty-3"></a>QDeclarativeProperty::<span class="name">QDeclarativeProperty</span> ( <span class="type"><a href="qobject.html">QObject</a></span> * <i>obj</i>, <span class="type"><a href="qdeclarativecontext.html">QDeclarativeContext</a></span> * <i>ctxt</i> )</h3> <p>Creates a <a href="qdeclarativeproperty.html">QDeclarativeProperty</a> for the default property of <i>obj</i> using the <a href="qdeclarativecontext.html">context</a> <i>ctxt</i>. If there is no default property, an invalid <a href="qdeclarativeproperty.html">QDeclarativeProperty</a> will be created.</p> <!-- @@@QDeclarativeProperty --> <!-- $$$QDeclarativeProperty$$$QDeclarativePropertyQObject*QDeclarativeEngine* --> <h3 class="fn"><a name="QDeclarativeProperty-4"></a>QDeclarativeProperty::<span class="name">QDeclarativeProperty</span> ( <span class="type"><a href="qobject.html">QObject</a></span> * <i>obj</i>, <span class="type"><a href="qdeclarativeengine.html">QDeclarativeEngine</a></span> * <i>engine</i> )</h3> <p>Creates a <a href="qdeclarativeproperty.html">QDeclarativeProperty</a> for the default property of <i>obj</i> using the environment for instantiating QML components that is provided by <i>engine</i>. If there is no default property, an invalid <a href="qdeclarativeproperty.html">QDeclarativeProperty</a> will be created.</p> <!-- @@@QDeclarativeProperty --> <!-- $$$QDeclarativeProperty$$$QDeclarativePropertyQObject*constQString& --> <h3 class="fn"><a name="QDeclarativeProperty-5"></a>QDeclarativeProperty::<span class="name">QDeclarativeProperty</span> ( <span class="type"><a href="qobject.html">QObject</a></span> * <i>obj</i>, const <span class="type"><a href="qstring.html">QString</a></span> & <i>name</i> )</h3> <p>Creates a <a href="qdeclarativeproperty.html">QDeclarativeProperty</a> for the property <i>name</i> of <i>obj</i>.</p> <!-- @@@QDeclarativeProperty --> <!-- $$$QDeclarativeProperty$$$QDeclarativePropertyQObject*constQString&QDeclarativeContext* --> <h3 class="fn"><a name="QDeclarativeProperty-6"></a>QDeclarativeProperty::<span class="name">QDeclarativeProperty</span> ( <span class="type"><a href="qobject.html">QObject</a></span> * <i>obj</i>, const <span class="type"><a href="qstring.html">QString</a></span> & <i>name</i>, <span class="type"><a href="qdeclarativecontext.html">QDeclarativeContext</a></span> * <i>ctxt</i> )</h3> <p>Creates a <a href="qdeclarativeproperty.html">QDeclarativeProperty</a> for the property <i>name</i> of <i>obj</i> using the <a href="qdeclarativecontext.html">context</a> <i>ctxt</i>.</p> <p>Creating a <a href="qdeclarativeproperty.html">QDeclarativeProperty</a> without a context will render some properties - like attached properties - inaccessible.</p> <!-- @@@QDeclarativeProperty --> <!-- $$$QDeclarativeProperty$$$QDeclarativePropertyQObject*constQString&QDeclarativeEngine* --> <h3 class="fn"><a name="QDeclarativeProperty-7"></a>QDeclarativeProperty::<span class="name">QDeclarativeProperty</span> ( <span class="type"><a href="qobject.html">QObject</a></span> * <i>obj</i>, const <span class="type"><a href="qstring.html">QString</a></span> & <i>name</i>, <span class="type"><a href="qdeclarativeengine.html">QDeclarativeEngine</a></span> * <i>engine</i> )</h3> <p>Creates a <a href="qdeclarativeproperty.html">QDeclarativeProperty</a> for the property <i>name</i> of <i>obj</i> using the environment for instantiating QML components that is provided by <i>engine</i>.</p> <!-- @@@QDeclarativeProperty --> <!-- $$$QDeclarativeProperty$$$QDeclarativePropertyconstQDeclarativeProperty& --> <h3 class="fn"><a name="QDeclarativeProperty-8"></a>QDeclarativeProperty::<span class="name">QDeclarativeProperty</span> ( const <span class="type">QDeclarativeProperty</span> & <i>other</i> )</h3> <p>Create a copy of <i>other</i>.</p> <!-- @@@QDeclarativeProperty --> <!-- $$$connectNotifySignal[overload1]$$$connectNotifySignalQObject*constchar* --> <h3 class="fn"><a name="connectNotifySignal"></a><span class="type">bool</span> QDeclarativeProperty::<span class="name">connectNotifySignal</span> ( <span class="type"><a href="qobject.html">QObject</a></span> * <i>dest</i>, const <span class="type">char</span> * <i>slot</i> ) const</h3> <p>Connects the property's change notifier signal to the specified <i>slot</i> of the <i>dest</i> object and returns true. Returns false if this metaproperty does not represent a regular Qt property or if it has no change notifier signal, or if the <i>dest</i> object does not have the specified <i>slot</i>.</p> <!-- @@@connectNotifySignal --> <!-- $$$connectNotifySignal$$$connectNotifySignalQObject*int --> <h3 class="fn"><a name="connectNotifySignal-2"></a><span class="type">bool</span> QDeclarativeProperty::<span class="name">connectNotifySignal</span> ( <span class="type"><a href="qobject.html">QObject</a></span> * <i>dest</i>, <span class="type">int</span> <i>method</i> ) const</h3> <p>Connects the property's change notifier signal to the specified <i>method</i> of the <i>dest</i> object and returns true. Returns false if this metaproperty does not represent a regular Qt property or if it has no change notifier signal, or if the <i>dest</i> object does not have the specified <i>method</i>.</p> <!-- @@@connectNotifySignal --> <!-- $$$hasNotifySignal[overload1]$$$hasNotifySignal --> <h3 class="fn"><a name="hasNotifySignal"></a><span class="type">bool</span> QDeclarativeProperty::<span class="name">hasNotifySignal</span> () const</h3> <p>Returns true if the property has a change notifier signal, otherwise false.</p> <!-- @@@hasNotifySignal --> <!-- $$$index[overload1]$$$index --> <h3 class="fn"><a name="index"></a><span class="type">int</span> QDeclarativeProperty::<span class="name">index</span> () const</h3> <p>Return the Qt metaobject index of the property.</p> <!-- @@@index --> <!-- $$$isDesignable[overload1]$$$isDesignable --> <h3 class="fn"><a name="isDesignable"></a><span class="type">bool</span> QDeclarativeProperty::<span class="name">isDesignable</span> () const</h3> <p>Returns true if the property is designable, otherwise false.</p> <!-- @@@isDesignable --> <!-- $$$isProperty[overload1]$$$isProperty --> <h3 class="fn"><a name="isProperty"></a><span class="type">bool</span> QDeclarativeProperty::<span class="name">isProperty</span> () const</h3> <p>Returns true if this <a href="qdeclarativeproperty.html">QDeclarativeProperty</a> represents a regular Qt property.</p> <!-- @@@isProperty --> <!-- $$$isResettable[overload1]$$$isResettable --> <h3 class="fn"><a name="isResettable"></a><span class="type">bool</span> QDeclarativeProperty::<span class="name">isResettable</span> () const</h3> <p>Returns true if the property is resettable, otherwise false.</p> <!-- @@@isResettable --> <!-- $$$isSignalProperty[overload1]$$$isSignalProperty --> <h3 class="fn"><a name="isSignalProperty"></a><span class="type">bool</span> QDeclarativeProperty::<span class="name">isSignalProperty</span> () const</h3> <p>Returns true if this <a href="qdeclarativeproperty.html">QDeclarativeProperty</a> represents a QML signal property.</p> <!-- @@@isSignalProperty --> <!-- $$$isValid[overload1]$$$isValid --> <h3 class="fn"><a name="isValid"></a><span class="type">bool</span> QDeclarativeProperty::<span class="name">isValid</span> () const</h3> <p>Returns true if the <a href="qdeclarativeproperty.html">QDeclarativeProperty</a> refers to a valid property, otherwise false.</p> <!-- @@@isValid --> <!-- $$$isWritable[overload1]$$$isWritable --> <h3 class="fn"><a name="isWritable"></a><span class="type">bool</span> QDeclarativeProperty::<span class="name">isWritable</span> () const</h3> <p>Returns true if the property is writable, otherwise false.</p> <!-- @@@isWritable --> <!-- $$$method[overload1]$$$method --> <h3 class="fn"><a name="method"></a><span class="type"><a href="qmetamethod.html">QMetaMethod</a></span> QDeclarativeProperty::<span class="name">method</span> () const</h3> <p>Return the <a href="qmetamethod.html">QMetaMethod</a> for this property if it is a <a href="qdeclarativeproperty.html#Type-enum">SignalProperty</a>, otherwise returns an invalid <a href="qmetamethod.html">QMetaMethod</a>.</p> <!-- @@@method --> <!-- $$$name[overload1]$$$name --> <h3 class="fn"><a name="name"></a><span class="type"><a href="qstring.html">QString</a></span> QDeclarativeProperty::<span class="name">name</span> () const</h3> <p>Return the name of this QML property.</p> <!-- @@@name --> <!-- $$$needsNotifySignal[overload1]$$$needsNotifySignal --> <h3 class="fn"><a name="needsNotifySignal"></a><span class="type">bool</span> QDeclarativeProperty::<span class="name">needsNotifySignal</span> () const</h3> <p>Returns true if the property needs a change notifier signal for bindings to remain upto date, false otherwise.</p> <p>Some properties, such as attached properties or those whose value never changes, do not require a change notifier.</p> <!-- @@@needsNotifySignal --> <!-- $$$object[overload1]$$$object --> <h3 class="fn"><a name="object"></a><span class="type"><a href="qobject.html">QObject</a></span> * QDeclarativeProperty::<span class="name">object</span> () const</h3> <p>Returns the <a href="qdeclarativeproperty.html">QDeclarativeProperty</a>'s <a href="qobject.html">QObject</a>.</p> <!-- @@@object --> <!-- $$$property[overload1]$$$property --> <h3 class="fn"><a name="property"></a><span class="type"><a href="qmetaproperty.html">QMetaProperty</a></span> QDeclarativeProperty::<span class="name">property</span> () const</h3> <p>Returns the <a href="qmetaproperty.html">Qt property</a> associated with this QML property.</p> <!-- @@@property --> <!-- $$$propertyType[overload1]$$$propertyType --> <h3 class="fn"><a name="propertyType"></a><span class="type">int</span> QDeclarativeProperty::<span class="name">propertyType</span> () const</h3> <p>Returns the <a href="qvariant.html">QVariant</a> type of the property, or <a href="qvariant.html#Type-enum">QVariant::Invalid</a> if the property has no <a href="qvariant.html">QVariant</a> type.</p> <!-- @@@propertyType --> <!-- $$$propertyTypeCategory[overload1]$$$propertyTypeCategory --> <h3 class="fn"><a name="propertyTypeCategory"></a><span class="type"><a href="qdeclarativeproperty.html#PropertyTypeCategory-enum">PropertyTypeCategory</a></span> QDeclarativeProperty::<span class="name">propertyTypeCategory</span> () const</h3> <p>Returns the property category.</p> <!-- @@@propertyTypeCategory --> <!-- $$$propertyTypeName[overload1]$$$propertyTypeName --> <h3 class="fn"><a name="propertyTypeName"></a>const <span class="type">char</span> * QDeclarativeProperty::<span class="name">propertyTypeName</span> () const</h3> <p>Returns the type name of the property, or 0 if the property has no type name.</p> <!-- @@@propertyTypeName --> <!-- $$$read[overload1]$$$read --> <h3 class="fn"><a name="read"></a><span class="type"><a href="qvariant.html">QVariant</a></span> QDeclarativeProperty::<span class="name">read</span> () const</h3> <p>Returns the property value.</p> <!-- @@@read --> <!-- $$$read$$$readQObject*constQString& --> <h3 class="fn"><a name="read-2"></a><span class="type"><a href="qvariant.html">QVariant</a></span> QDeclarativeProperty::<span class="name">read</span> ( <span class="type"><a href="qobject.html">QObject</a></span> * <i>object</i>, const <span class="type"><a href="qstring.html">QString</a></span> & <i>name</i> )<tt> [static]</tt></h3> <p>Return the <i>name</i> property value of <i>object</i>. This method is equivalent to:</p> <pre class="cpp"> <span class="type"><a href="qdeclarativeproperty.html">QDeclarativeProperty</a></span> p(object<span class="operator">,</span> name); p<span class="operator">.</span><a href="qdeclarativeproperty.html#read">read</a>();</pre> <!-- @@@read --> <!-- $$$read$$$readQObject*constQString&QDeclarativeContext* --> <h3 class="fn"><a name="read-3"></a><span class="type"><a href="qvariant.html">QVariant</a></span> QDeclarativeProperty::<span class="name">read</span> ( <span class="type"><a href="qobject.html">QObject</a></span> * <i>object</i>, const <span class="type"><a href="qstring.html">QString</a></span> & <i>name</i>, <span class="type"><a href="qdeclarativecontext.html">QDeclarativeContext</a></span> * <i>ctxt</i> )<tt> [static]</tt></h3> <p>Return the <i>name</i> property value of <i>object</i> using the <a href="qdeclarativecontext.html">context</a> <i>ctxt</i>. This method is equivalent to:</p> <pre class="cpp"> <span class="type"><a href="qdeclarativeproperty.html">QDeclarativeProperty</a></span> p(object<span class="operator">,</span> name<span class="operator">,</span> context); p<span class="operator">.</span><a href="qdeclarativeproperty.html#read">read</a>();</pre> <!-- @@@read --> <!-- $$$read$$$readQObject*constQString&QDeclarativeEngine* --> <h3 class="fn"><a name="read-4"></a><span class="type"><a href="qvariant.html">QVariant</a></span> QDeclarativeProperty::<span class="name">read</span> ( <span class="type"><a href="qobject.html">QObject</a></span> * <i>object</i>, const <span class="type"><a href="qstring.html">QString</a></span> & <i>name</i>, <span class="type"><a href="qdeclarativeengine.html">QDeclarativeEngine</a></span> * <i>engine</i> )<tt> [static]</tt></h3> <p>Return the <i>name</i> property value of <i>object</i> using the environment for instantiating QML components that is provided by <i>engine</i>. . This method is equivalent to:</p> <pre class="cpp"> <span class="type"><a href="qdeclarativeproperty.html">QDeclarativeProperty</a></span> p(object<span class="operator">,</span> name<span class="operator">,</span> engine); p<span class="operator">.</span><a href="qdeclarativeproperty.html#read">read</a>();</pre> <!-- @@@read --> <!-- $$$reset[overload1]$$$reset --> <h3 class="fn"><a name="reset"></a><span class="type">bool</span> QDeclarativeProperty::<span class="name">reset</span> () const</h3> <p>Resets the property and returns true if the property is resettable. If the property is not resettable, nothing happens and false is returned.</p> <!-- @@@reset --> <!-- $$$type[overload1]$$$type --> <h3 class="fn"><a name="type"></a><span class="type"><a href="qdeclarativeproperty.html#Type-enum">Type</a></span> QDeclarativeProperty::<span class="name">type</span> () const</h3> <p>Returns the type of the property.</p> <!-- @@@type --> <!-- $$$write[overload1]$$$writeconstQVariant& --> <h3 class="fn"><a name="write"></a><span class="type">bool</span> QDeclarativeProperty::<span class="name">write</span> ( const <span class="type"><a href="qvariant.html">QVariant</a></span> & <i>value</i> ) const</h3> <p>Sets the property value to <i>value</i> and returns true. Returns false if the property can't be set because the <i>value</i> is the wrong type, for example.</p> <!-- @@@write --> <!-- $$$write$$$writeQObject*constQString&constQVariant& --> <h3 class="fn"><a name="write-2"></a><span class="type">bool</span> QDeclarativeProperty::<span class="name">write</span> ( <span class="type"><a href="qobject.html">QObject</a></span> * <i>object</i>, const <span class="type"><a href="qstring.html">QString</a></span> & <i>name</i>, const <span class="type"><a href="qvariant.html">QVariant</a></span> & <i>value</i> )<tt> [static]</tt></h3> <p>Writes <i>value</i> to the <i>name</i> property of <i>object</i>. This method is equivalent to:</p> <pre class="cpp"> <span class="type"><a href="qdeclarativeproperty.html">QDeclarativeProperty</a></span> p(object<span class="operator">,</span> name); p<span class="operator">.</span><a href="qdeclarativeproperty.html#write">write</a>(value);</pre> <!-- @@@write --> <!-- $$$write$$$writeQObject*constQString&constQVariant&QDeclarativeContext* --> <h3 class="fn"><a name="write-3"></a><span class="type">bool</span> QDeclarativeProperty::<span class="name">write</span> ( <span class="type"><a href="qobject.html">QObject</a></span> * <i>object</i>, const <span class="type"><a href="qstring.html">QString</a></span> & <i>name</i>, const <span class="type"><a href="qvariant.html">QVariant</a></span> & <i>value</i>, <span class="type"><a href="qdeclarativecontext.html">QDeclarativeContext</a></span> * <i>ctxt</i> )<tt> [static]</tt></h3> <p>Writes <i>value</i> to the <i>name</i> property of <i>object</i> using the <a href="qdeclarativecontext.html">context</a> <i>ctxt</i>. This method is equivalent to:</p> <pre class="cpp"> <span class="type"><a href="qdeclarativeproperty.html">QDeclarativeProperty</a></span> p(object<span class="operator">,</span> name<span class="operator">,</span> ctxt); p<span class="operator">.</span><a href="qdeclarativeproperty.html#write">write</a>(value);</pre> <!-- @@@write --> <!-- $$$write$$$writeQObject*constQString&constQVariant&QDeclarativeEngine* --> <h3 class="fn"><a name="write-4"></a><span class="type">bool</span> QDeclarativeProperty::<span class="name">write</span> ( <span class="type"><a href="qobject.html">QObject</a></span> * <i>object</i>, const <span class="type"><a href="qstring.html">QString</a></span> & <i>name</i>, const <span class="type"><a href="qvariant.html">QVariant</a></span> & <i>value</i>, <span class="type"><a href="qdeclarativeengine.html">QDeclarativeEngine</a></span> * <i>engine</i> )<tt> [static]</tt></h3> <p>Writes <i>value</i> to the <i>name</i> property of <i>object</i> using the environment for instantiating QML components that is provided by <i>engine</i>. This method is equivalent to:</p> <pre class="cpp"> <span class="type"><a href="qdeclarativeproperty.html">QDeclarativeProperty</a></span> p(object<span class="operator">,</span> name<span class="operator">,</span> engine); p<span class="operator">.</span><a href="qdeclarativeproperty.html#write">write</a>(value);</pre> <!-- @@@write --> <!-- $$$operator=[overload1]$$$operator=constQDeclarativeProperty& --> <h3 class="fn"><a name="operator-eq"></a><span class="type">QDeclarativeProperty</span> & QDeclarativeProperty::<span class="name">operator=</span> ( const <span class="type">QDeclarativeProperty</span> & <i>other</i> )</h3> <p>Assign <i>other</i> to this <a href="qdeclarativeproperty.html">QDeclarativeProperty</a>.</p> <!-- @@@operator= --> <!-- $$$operator==[overload1]$$$operator==constQDeclarativeProperty& --> <h3 class="fn"><a name="operator-eq-eq"></a><span class="type">bool</span> QDeclarativeProperty::<span class="name">operator==</span> ( const <span class="type">QDeclarativeProperty</span> & <i>other</i> ) const</h3> <p>Returns true if <i>other</i> and this <a href="qdeclarativeproperty.html">QDeclarativeProperty</a> represent the same property.</p> <!-- @@@operator== --> </div> </div> </div> </div> <div class="ft"> <span></span> </div> </div> <div class="footer"> <p> <acronym title="Copyright">©</acronym> 2013 Digia Plc and/or its subsidiaries. Documentation contributions included herein are the copyrights of their respective owners.</p> <br /> <p> The documentation provided herein is licensed under the terms of the <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation License version 1.3</a> as published by the Free Software Foundation.</p> <p> Documentation sources may be obtained from <a href="http://www.qt-project.org"> www.qt-project.org</a>.</p> <br /> <p> Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide. All other trademarks are property of their respective owners. <a title="Privacy Policy" href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p> </div> <script src="scripts/functions.js" type="text/javascript"></script> </body> </html>