diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-07-16 10:44:09 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-07-16 10:44:09 (GMT) |
commit | 636698a5f97401a9aeb18cd690d7f08b05dcd5e6 (patch) | |
tree | 65050b764e1aeb3f002cd929ce443cb26ff98a2a /doc/src/declarative | |
parent | 8d8566d061e26f18e1bde1255fdc1375035c8eaa (diff) | |
parent | 975b1913e44128a3e9b9055f9bf2ff40d86adf2a (diff) | |
download | Qt-636698a5f97401a9aeb18cd690d7f08b05dcd5e6.zip Qt-636698a5f97401a9aeb18cd690d7f08b05dcd5e6.tar.gz Qt-636698a5f97401a9aeb18cd690d7f08b05dcd5e6.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-qml:
Fix RightBearing confusion in text layout
fixes, improvements for various docs and example code
Fixed debugger's evaluation of dynamic properties in context
Allow test to pass on smaller screens (eg. 480 high).
Minor animation doc improvement
Diffstat (limited to 'doc/src/declarative')
-rw-r--r-- | doc/src/declarative/animation.qdoc | 4 | ||||
-rw-r--r-- | doc/src/declarative/qdeclarativemodels.qdoc | 16 |
2 files changed, 17 insertions, 3 deletions
diff --git a/doc/src/declarative/animation.qdoc b/doc/src/declarative/animation.qdoc index c5333df..401cf16 100644 --- a/doc/src/declarative/animation.qdoc +++ b/doc/src/declarative/animation.qdoc @@ -67,7 +67,9 @@ A property animation can also be specified as a resource that is manipulated fro \snippet doc/src/snippets/declarative/animation.qml property-anim-3 As can be seen, when an animation is used like this (as opposed to as a value source) you will need -to explicitly set the \c target and \c property to animate. +to explicitly set the \c target and \c property to animate. This also the only case where +an animation needs to be started explictly by either setting the \c running property to +true or calling the \c start() method. Animations can be joined into a group using SequentialAnimation and ParallelAnimation. diff --git a/doc/src/declarative/qdeclarativemodels.qdoc b/doc/src/declarative/qdeclarativemodels.qdoc index a2f4d3a..173002a 100644 --- a/doc/src/declarative/qdeclarativemodels.qdoc +++ b/doc/src/declarative/qdeclarativemodels.qdoc @@ -208,7 +208,10 @@ Models can be defined in C++ and then made available to QML. This is useful for exposing existing C++ data models or otherwise complex datasets to QML. A C++ model class can be defined as a QStringList, a QList<QObject*> or a -QAbstractItemModel. +QAbstractItemModel. The first two are useful for exposing simpler datasets, +while QAbstractItemModel provides a more flexible solution for more complex +models. + \section2 QStringList @@ -268,7 +271,10 @@ the model by calling QDeclarativeContext::setContextProperty() again. \section2 QAbstractItemModel -A model can be defined by subclassing QAbstractItemModel. +A model can be defined by subclassing QAbstractItemModel. This is the +best approach if you have a more complex model that cannot be supported +by the other approaches. A QAbstractItemModel can also automatically +notify a QML view when the model data has changed. The roles of a QAbstractItemModel subclass can be exposed to QML by calling QAbstractItemModel::setRoleNames(). The default role names set by Qt are: @@ -305,6 +311,12 @@ roles: \snippet examples/declarative/modelviews/abstractitemmodel/view.qml 0 +QML views are automatically updated when the model changes. Remember the model +must follow the standard rules for model changes and notify the view when +the model has changed by using QAbstractItemModel::dataChanged(), +QAbstractItemModel::beginInsertRows(), etc. See the \l {Model subclassing reference} for +more information. + The complete example is available in Qt's \l {declarative/modelviews/abstractitemmodel}{examples/declarative/modelviews/abstractitemmodel} directory. QAbstractItemModel presents a hierarchy of tables, but the views currently provided by QML |