summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2011-04-12 14:35:07 -0300
committerRenato Filho <renato.filho@openbossa.org>2011-04-12 17:48:46 -0300
commit741bc56e4b915793273c2bc661e628c20b8845c9 (patch)
treeaf2004ae8a4550ac4f2dd3a10d9d61b79fea31e8 /doc
parentc8a11c179a19781e53355088996527345b525748 (diff)
downloadpyside-741bc56e4b915793273c2bc661e628c20b8845c9.tar.gz
pyside-741bc56e4b915793273c2bc661e628c20b8845c9.tar.xz
pyside-741bc56e4b915793273c2bc661e628c20b8845c9.zip
Created QtDeclarative.ListProperty documentation.
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Hugo Parente Lima <hugo.pl@gmail.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/extras/PySide.QtDeclarative.ListProperty.rst46
1 files changed, 46 insertions, 0 deletions
diff --git a/doc/extras/PySide.QtDeclarative.ListProperty.rst b/doc/extras/PySide.QtDeclarative.ListProperty.rst
new file mode 100644
index 0000000..dcbd57f
--- /dev/null
+++ b/doc/extras/PySide.QtDeclarative.ListProperty.rst
@@ -0,0 +1,46 @@
+.. module:: PySide.QtDeclarative
+.. _ListProperty:
+
+ListProperty
+************
+
+Synopsis
+--------
+
+ The The :class:`~.ListProperty` class allows applications to expose list-like properties to QML.
+
+Detailed Description
+--------------------
+
+ The :class:`~.ListProperty` class provides a replacement to QDeclarativeListProperty.
+
+ :class:`~.ListProperty` is a subclass of :class:`QtCore.Property`, that support the following keywords.
+
+ `type` the type used in the list
+ `append` Function used to append itens
+ `at` Function used to retrieve item from the list
+ `clear` Function used to clear the list
+ `count` Function used to retrieve the list size
+
+
+ QML has many list properties, where more than one object value can be assigned. The use of a list property from QML looks like this:
+
+ ::
+ FruitBasket {
+ fruit: [
+ Apple {},
+ Orange{},
+ Banana{}
+ ]
+ }
+
+ The :class:`~.ListProperty` encapsulates a group of callbacks that represent the set of actions QML can perform on the list - adding items, retrieving items and clearing the list. In the future, additional operations may be supported. All list properties must implement the append operation, but the rest are optional.
+ To provide a list property, a class must implement the operation callbacks, and then return an appropriate value from the property getter. List properties should have no setter. In the example above, the ListProperty declarative will look like this:
+
+ ::
+ slices = ListProperty(PieSlice, append=appendSlice)
+
+
+ Note: :class:`~.ListProperty` can only be used for lists of QObject-derived object pointers.
+
+