aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2011-04-12 14:35:07 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:54:09 -0300
commitb1ab2a02604bca8abfb18a2f626643a52c5d4453 (patch)
treeabb59a29aa57492870047e4ddd98dd2e991d0471 /doc
parentb3a3a293635281c0e55ee016e3dab77d465d5bb3 (diff)
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 000000000..dcbd57f2d
--- /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.
+
+