aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/doc/tutorials/qmlapp/Main
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2024-08-09 09:40:58 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2024-08-09 14:10:24 +0200
commit55c082ebe8c1cd1111ad8d772c13ddebb3b75502 (patch)
treee8143bbee75b2906cf2062792a6454b79aebfa42 /sources/pyside6/doc/tutorials/qmlapp/Main
parent8ff61a10d142e6f51efcc26535f460e33a1cc0ed (diff)
Documentation: Rewrite 'QML Application' tutorial to use loadFromModule()
Pick-to: 6.7 Task-number: PYSIDE-2833 Change-Id: I8c4e9af9fe46cdd57f3fba65f8d9200512addea0 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
Diffstat (limited to 'sources/pyside6/doc/tutorials/qmlapp/Main')
-rw-r--r--sources/pyside6/doc/tutorials/qmlapp/Main/Main.qml56
-rw-r--r--sources/pyside6/doc/tutorials/qmlapp/Main/logo.pngbin0 -> 6208 bytes
-rw-r--r--sources/pyside6/doc/tutorials/qmlapp/Main/qmldir2
3 files changed, 58 insertions, 0 deletions
diff --git a/sources/pyside6/doc/tutorials/qmlapp/Main/Main.qml b/sources/pyside6/doc/tutorials/qmlapp/Main/Main.qml
new file mode 100644
index 000000000..7f9b1d777
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/qmlapp/Main/Main.qml
@@ -0,0 +1,56 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick 2.12
+import QtQuick.Controls 2.12
+
+Page {
+ width: 640
+ height: 480
+ required property var myModel
+
+ header: Label {
+ color: "#15af15"
+ text: qsTr("Where do people use Qt?")
+ font.pointSize: 17
+ font.bold: true
+ font.family: "Arial"
+ renderType: Text.NativeRendering
+ horizontalAlignment: Text.AlignHCenter
+ padding: 10
+ }
+ Rectangle {
+ id: root
+ width: parent.width
+ height: parent.height
+
+ Image {
+ id: image
+ fillMode: Image.PreserveAspectFit
+ anchors.centerIn: root
+ source: "./logo.png"
+ opacity: 0.5
+
+ }
+
+ ListView {
+ id: view
+ anchors.fill: root
+ anchors.margins: 25
+ model: myModel
+ delegate: Text {
+ anchors.leftMargin: 50
+ font.pointSize: 15
+ horizontalAlignment: Text.AlignHCenter
+ text: display
+ }
+ }
+ }
+ NumberAnimation {
+ id: anim
+ running: true
+ target: view
+ property: "contentY"
+ duration: 500
+ }
+}
diff --git a/sources/pyside6/doc/tutorials/qmlapp/Main/logo.png b/sources/pyside6/doc/tutorials/qmlapp/Main/logo.png
new file mode 100644
index 000000000..30c621c9c
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/qmlapp/Main/logo.png
Binary files differ
diff --git a/sources/pyside6/doc/tutorials/qmlapp/Main/qmldir b/sources/pyside6/doc/tutorials/qmlapp/Main/qmldir
new file mode 100644
index 000000000..8ad738e16
--- /dev/null
+++ b/sources/pyside6/doc/tutorials/qmlapp/Main/qmldir
@@ -0,0 +1,2 @@
+module Main
+Main 254.0 Main.qml