diff options
author | Venugopal Shivashankar <venugopal.shivashankar@digia.com> | 2015-08-04 14:10:22 +0200 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@theqtcompany.com> | 2015-08-07 08:20:10 +0000 |
commit | 74bc515a67e2ae66323fd735dec198c66187ba17 (patch) | |
tree | 3a8a1540c1b35a39196bb7222d3c9502671a2ec8 /src/controls | |
parent | 3aeb0261ad809220965d5bea57109911c1dbb3cb (diff) |
Doc: Added documentation for the StackView QML type
Added a short description with a snippet
Change-Id: I861647610e13a9e2209eb4449a20ace0373d3208
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'src/controls')
-rw-r--r-- | src/controls/qquickstackview.cpp | 48 |
1 files changed, 46 insertions, 2 deletions
diff --git a/src/controls/qquickstackview.cpp b/src/controls/qquickstackview.cpp index baf98434..9cbc8a88 100644 --- a/src/controls/qquickstackview.cpp +++ b/src/controls/qquickstackview.cpp @@ -49,9 +49,53 @@ QT_BEGIN_NAMESPACE \instantiates QQuickStackView \inqmlmodule QtQuick.Controls \ingroup navigation - \brief A stack view control. + \brief Provides a stack-based navigation model. + + StackView can be used with a set of inter-linked information pages. For + example, an email application with separate views to list latest emails, + view a specific email, and list/view the attachments. The email list view + is pushed onto the stack as users open an email, and popped out as they + choose to go back. + + The following snippet demonstrates a simple use case, where the \c mainView + is pushed onto and popped out of the stack on relevant button click: + + \qml + ApplicationWindow { + title: qsTr("Hello World") + width: 640 + height: 480 + visible: true + + StackView { + id: stack + initialItem: mainView + anchors.fill: parent + } - TODO + Component { + id: mainView + + Row { + spacing: 10 + + Button { + text: "Push" + onClicked: stack.push(mainView) + } + Button { + text: "Pop" + enabled: stack.depth > 1 + onClicked: stack.pop() + + } + Text { + text: stack.depth + } + } + } + } + \endqml */ QQuickStackView::QQuickStackView(QQuickItem *parent) : |