From 7e745bbba235c41107292da06dc63beabf3c913c Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Thu, 27 Apr 2023 13:20:28 +0800 Subject: 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. Pick-to: 6.5 Change-Id: Id4019076d55199a9cafe4acdced1a7efc64bb3f2 Reviewed-by: Oliver Eftevaag --- .../qtquickcontrols-container-oncurrentindexchanged.qml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/quickcontrols/doc/snippets/qtquickcontrols-container-oncurrentindexchanged.qml (limited to 'src/quickcontrols/doc/snippets') 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] +} -- cgit v1.2.3