aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2010-07-08 13:52:29 -0300
committerRenato Filho <renato.filho@openbossa.org>2010-07-08 13:53:14 -0300
commitf1bbc25546b688e8a0766212a24f2d1eacc826c7 (patch)
tree37e20b2323ecad196a1c31b5ce22fc0b741e84d5 /doc
parent7431ae12a45baffd2a365f9382ffaa8adeb66957 (diff)
Created QProperty documentation.
Reviewer: Hugo Parente Lima <hugo.lima@openbossa.org>, Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'doc')
-rw-r--r--doc/_templates/index.html11
-rw-r--r--doc/property.rst44
2 files changed, 51 insertions, 4 deletions
diff --git a/doc/_templates/index.html b/doc/_templates/index.html
index bae2f7bc4..d0bc1a6b1 100644
--- a/doc/_templates/index.html
+++ b/doc/_templates/index.html
@@ -16,17 +16,20 @@
<td width="50%">
<p class="biglink"><a class="biglink" href="{{ pathto("issuesdiff") }}">PyQt Incompatibilities</a><br/>
<span class="linkdescr">PySide issues and specificities</span></p>
+ <p class="biglink"><a class="biglink" href="{{ pathto("dbus") }}">DBus</a><br/>
+ <span class="linkdescr">DBus integration</span></p>
<p class="biglink"><a class="biglink" href="{{ pathto("howto-build/index") }}">How to build</a><br/>
<span class="linkdescr">building compiling and installing PySide</span></p>
- <p class="biglink"><a class="biglink" href="{{ pathto("newsigslot") }}">New-style signal/slot</a><br/>
- <span class="linkdescr">using the new-style signal/slot scheme</span></p>
</td>
<td width="50%">
<p class="biglink"><a class="biglink" href="{{ pathto("contents") }}">Contents</a><br/>
<span class="linkdescr">for a complete overview</span></p>
- <p class="biglink"><a class="biglink" href="{{ pathto("dbus") }}">DBus</a><br/>
- <span class="linkdescr">DBus integration</span></p>
+ <p class="biglink"><a class="biglink" href="{{ pathto("newsigslot") }}">New-style signal/slot</a><br/>
+ <span class="linkdescr">using the new-style signal/slot scheme</span></p>
+
+ <p class="biglink"><a class="biglink" href="{{ pathto("property") }}">Use of QPropery in PySide</a><br/>
+ <span class="linkdescr">QProperty</span></p>
</td></tr>
</table>
diff --git a/doc/property.rst b/doc/property.rst
new file mode 100644
index 000000000..0b9b35cee
--- /dev/null
+++ b/doc/property.rst
@@ -0,0 +1,44 @@
+Use of QPropery in PySide
+*************************
+
+PySide implements the function 'QProperty' which allows to declare properties compatible with QMetaProperties.
+
+
+Using PySide.QProperty()
+------------------------
+
+The QProperty works like Q_PROPERTY macro, and uses the same arguments.
+
+QProperty(getFunction, [setFunction], [resetFunction], [Designable], [Scriptable], [Stored], [User])
+
+
+The example below uses QProperty function to export a property in QMetaObject data.
+
+::
+
+ ...
+ clas MyObject(QObject):
+ def getX(self):
+ ...
+
+ def setX(self, value):
+ ...
+
+ def resetX(self):
+ ...
+
+ X = QProperty(getX, setX, resetX, True, True, True, True)
+
+ ...
+
+
+The exported property works like native python property on python side. See the example below.
+
+::
+
+ ...
+ o = MyObject()
+ o.X = 10
+ print o.X
+ ...
+