aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDoris Verria <doris.verria@qt.io>2022-05-31 12:56:37 +0200
committerDoris Verria <doris.verria@qt.io>2022-06-01 05:26:40 +0200
commit07972d8b23f682608b3c01854ee24449b64069a7 (patch)
treed978472b9dfbdc8624f61eeb21fcff881f4512f7 /src
parent04d8bc9fe3fc820fac80edf2d1ce259e5182b087 (diff)
iOS Style: Add StackView control
Change-Id: I450c81c884a012aad8188912875ace3f160f1a1e Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/quickcontrols2/ios/CMakeLists.txt1
-rw-r--r--src/quickcontrols2/ios/StackView.qml71
2 files changed, 72 insertions, 0 deletions
diff --git a/src/quickcontrols2/ios/CMakeLists.txt b/src/quickcontrols2/ios/CMakeLists.txt
index bac08122c7..5a57393f0b 100644
--- a/src/quickcontrols2/ios/CMakeLists.txt
+++ b/src/quickcontrols2/ios/CMakeLists.txt
@@ -21,6 +21,7 @@ set(qml_files
"RadioDelegate.qml"
"CheckDelegate.qml"
"SwipeDelegate.qml"
+ "StackView.qml"
)
set_source_files_properties(Slider.qml PROPERTIES
QT_QML_SOURCE_VERSIONS "2.2;6.0"
diff --git a/src/quickcontrols2/ios/StackView.qml b/src/quickcontrols2/ios/StackView.qml
new file mode 100644
index 0000000000..ac310843a6
--- /dev/null
+++ b/src/quickcontrols2/ios/StackView.qml
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2022 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick
+import QtQuick.Templates as T
+import QtQuick.Controls.impl
+import QtQuick.Controls.iOS
+
+T.StackView {
+ id: control
+
+ popEnter: Transition {
+ XAnimator { from: (control.mirrored ? -1 : 1) * -control.width; to: 0; duration: 1000; easing.type: Easing.OutCubic }
+ }
+
+ popExit: Transition {
+ XAnimator { from: 0; to: (control.mirrored ? -1 : 1) * control.width; duration: 1000; easing.type: Easing.OutCubic }
+ }
+
+ pushEnter: Transition {
+ XAnimator { from: (control.mirrored ? -1 : 1) * control.width; to: 0; duration: 1000; easing.type: Easing.OutCubic }
+ }
+
+ pushExit: Transition {
+ XAnimator { from: 0; to: (control.mirrored ? -1 : 1) * -control.width; duration: 1000; easing.type: Easing.OutCubic }
+ }
+
+ replaceEnter: Transition {
+ XAnimator { from: (control.mirrored ? -1 : 1) * control.width; to: 0; duration: 1000; easing.type: Easing.OutCubic }
+ }
+
+ replaceExit: Transition {
+ XAnimator { from: 0; to: (control.mirrored ? -1 : 1) * -control.width; duration: 1000; easing.type: Easing.OutCubic }
+ }
+}