aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickcontrols/doc/snippets
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2023-04-27 13:20:28 +0800
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-05-03 04:10:26 +0000
commit76372d0d0b84a1f594082ad4b27154ee2a314d76 (patch)
tree546ead10865c3096b927649dca1845d6c67ff12c /src/quickcontrols/doc/snippets
parent40d39636afa2438b4373b2e5cacd6d6f5431a05a (diff)
Doc: explain how to handle currentIndex changes in TabBar and SwipeView
Add a snippet and link to property change signal handlers to explain the concept, since that page is hard to find unless you know where to look. Change-Id: Id4019076d55199a9cafe4acdced1a7efc64bb3f2 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> (cherry picked from commit 7e745bbba235c41107292da06dc63beabf3c913c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/quickcontrols/doc/snippets')
-rw-r--r--src/quickcontrols/doc/snippets/qtquickcontrols-container-oncurrentindexchanged.qml13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/quickcontrols/doc/snippets/qtquickcontrols-container-oncurrentindexchanged.qml b/src/quickcontrols/doc/snippets/qtquickcontrols-container-oncurrentindexchanged.qml
new file mode 100644
index 0000000000..e018486fef
--- /dev/null
+++ b/src/quickcontrols/doc/snippets/qtquickcontrols-container-oncurrentindexchanged.qml
@@ -0,0 +1,13 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+import QtQuick.Controls
+
+Container {
+ //! [1]
+ onCurrentIndexChanged: {
+ print("currentIndex changed to", currentIndex)
+ // ...
+ }
+ //! [1]
+}