diff options
author | Andy Nichols <andy.nichols@qt.io> | 2023-06-08 16:25:47 +0200 |
---|---|---|
committer | Andy Nichols <nezticle@gmail.com> | 2023-06-12 16:05:36 +0200 |
commit | f7cc7656e2bd01851c5fb04747b0c8439ffa9dbe (patch) | |
tree | 3999f4a6efc61e1841e21941fd6bf8a51025d121 /examples/quick3d/particles3d/main.qml | |
parent | 16c734c0a26b5fed0542f3ef2fee07be74a45da8 (diff) |
Fix qmllint errors in particles3d example
Pick-to: 6.6
Change-Id: I10126755f2a42fb365219f09b9c54e45ed8e4316
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
Diffstat (limited to 'examples/quick3d/particles3d/main.qml')
-rw-r--r-- | examples/quick3d/particles3d/main.qml | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/examples/quick3d/particles3d/main.qml b/examples/quick3d/particles3d/main.qml new file mode 100644 index 00000000..95f5ee30 --- /dev/null +++ b/examples/quick3d/particles3d/main.qml @@ -0,0 +1,57 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +import QtQuick +import QtQuick.Controls + +Window { + id: rootWindow + + readonly property url startupView: "StartupView.qml" + + width: 1280 + height: 720 + visible: true + title: qsTr("Qt Quick 3D Particles3D Testbed") + color: "#000000" + + Component.onCompleted: { + AppSettings.iconSize = Qt.binding(function() { + return 16 + Math.max(rootWindow.width, rootWindow.height) * 0.05 + }) + } + + Loader { + id: loader + anchors.fill: parent + Component.onCompleted: setSource(rootWindow.startupView, {loader: loader}) + } + + Button { + id: backButton + anchors.left: parent.left + anchors.top: parent.top + implicitWidth: AppSettings.iconSize + implicitHeight: AppSettings.iconSize + //height: width + opacity: loader.source !== rootWindow.startupView + visible: opacity + icon.source: "qrc:/images/arrow_icon.png" + icon.width: backButton.width * 0.3 + icon.height: backButton.height * 0.3 + icon.color: "transparent" + background: Rectangle { + color: "transparent" + } + onClicked: { + loader.setSource(rootWindow.startupView, {loader: loader}) + } + Behavior on opacity { + NumberAnimation { + duration: 400 + easing.type: Easing.InOutQuad + } + } + } + +} |