From c94a6f44d5d1ba5532de48419ce10ef9000d4511 Mon Sep 17 00:00:00 2001 From: Caroline Chao Date: Thu, 30 May 2013 10:34:06 +0200 Subject: Doc: Make Stack attached properties more visible And use \qmlattachedproperty instead of \qmlproperty for properties in the Stack. Change-Id: I1ffbd84ce91fd5a9040c082a8bcb403589becf91 Reviewed-by: J-P Nurmi Reviewed-by: Jerome Pasion --- src/controls/StackView.qml | 11 +++++++++++ src/controls/qquickstack.cpp | 15 ++++++--------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/controls/StackView.qml b/src/controls/StackView.qml index 2c760e89..be1ddf06 100644 --- a/src/controls/StackView.qml +++ b/src/controls/StackView.qml @@ -65,6 +65,8 @@ import "Private/StackView.js" as JSArray The stack can then be used by invoking its navigation methods. The first item to show in the StackView is commonly loaded assigning it to \l initialItem. + \note Items pushed onto the stack view have \l{Supported Attached Properties}{Stack attached properties}. + \section1 Basic Navigation There are three primary navigation operations in StackView: push(), pop() and replace (you replace by specifying argument \c replace to push()). @@ -435,6 +437,15 @@ import "Private/StackView.js" as JSArray } } \endqml + + \section1 Supported Attached Properties + + Items in a StackView support these attached properties: + \list + \li \l{Stack::index}{Stack.index} - Contains the index of the item inside the StackView + \li \l{Stack::view}{Stack.view} - Contains the StackView the item is in + \li \l{Stack::status}{Stack.status} - Contains the status of the item + \endlist */ Item { diff --git a/src/controls/qquickstack.cpp b/src/controls/qquickstack.cpp index 5d3accff..ecf873d7 100644 --- a/src/controls/qquickstack.cpp +++ b/src/controls/qquickstack.cpp @@ -50,12 +50,9 @@ QT_BEGIN_NAMESPACE \ingroup views \brief Provides attached properties for items pushed onto a StackView. - The Stack attached property provides information when an item becomes - active or inactive through the \l{Stack::status}{Stack.status} property. - Status will be \c Stack.Activating when an item is transitioning into - being the current item on the screen, and \c Stack.Active once the - transition stops. When it leaves the screen, it will be - \c Stack.Deactivating, and then \c Stack.Inactive. + The Stack type provides attached properties for items pushed onto a \l StackView. + It gives specific information about the item, such as its \l status and + \l index in the stack \l view the item is in. \sa StackView */ @@ -75,7 +72,7 @@ QQuickStack *QQuickStack::qmlAttachedProperties(QObject *object) /*! \readonly - \qmlproperty int Stack::index + \qmlattachedproperty int Stack::index This property holds the index of the item inside \l{view}{StackView}, so that \l{StackView::get()}{StackView.get(index)} will return the item itself. @@ -96,7 +93,7 @@ void QQuickStack::setIndex(int index) /*! \readonly - \qmlproperty enumeration Stack::status + \qmlattachedproperty enumeration Stack::status This property holds the status of the item. It can have one of the following values: \list @@ -121,7 +118,7 @@ void QQuickStack::setStatus(Status status) /*! \readonly - \qmlproperty StackView Stack::view + \qmlattachedproperty StackView Stack::view This property holds the StackView the item is in. If the item is not inside a StackView, \a view will be \c null. -- cgit v1.2.1