aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAli Kianian <ali.kianian@qt.io>2023-11-22 15:39:35 +0200
committerAli Kianian <ali.kianian@qt.io>2023-11-22 16:25:40 +0000
commit50fe4051e34781f45f21e698927eba6b02484d5f (patch)
tree1b70aa41e5937af85dc861aadf962edb615d444b
parent1ed6674d1ec88b36ee97b47f82168d868ded26ea (diff)
QmlDesigner: Add the Collection Singleton to the QDS template
Change-Id: I8bad907766dfa0f630cee935d2b587fc613b0922 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io> Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
-rw-r--r--share/qtcreator/qmldesigner/studio_templates/projects/application-3d/wizard.json8
-rw-r--r--share/qtcreator/qmldesigner/studio_templates/projects/application/wizard.json8
-rw-r--r--share/qtcreator/qmldesigner/studio_templates/projects/desktop-launcher/wizard.json8
-rw-r--r--share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/CMakeLists.importmodule.txt.tpl1
-rw-r--r--share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/DataStore.json.tpl30
-rw-r--r--share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/DataStore.qml.tpl12
-rw-r--r--share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/importmodule.qmldir.tpl2
-rw-r--r--share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/qmldir1
-rw-r--r--share/qtcreator/templates/wizards/projects/qtquickapplication/wizard.json10
9 files changed, 79 insertions, 1 deletions
diff --git a/share/qtcreator/qmldesigner/studio_templates/projects/application-3d/wizard.json b/share/qtcreator/qmldesigner/studio_templates/projects/application-3d/wizard.json
index d5b1fef1e4..232dfd4319 100644
--- a/share/qtcreator/qmldesigner/studio_templates/projects/application-3d/wizard.json
+++ b/share/qtcreator/qmldesigner/studio_templates/projects/application-3d/wizard.json
@@ -368,6 +368,14 @@
"target": "%{ProjectDirectory}/imports/%{ImportModuleName}/Constants.qml"
},
{
+ "source": "../shared-plugin/name/DataStore.json.tpl",
+ "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/DataStore.json"
+ },
+ {
+ "source": "../shared-plugin/name/DataStore.qml.tpl",
+ "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/DataStore.qml"
+ },
+ {
"source": "../shared-plugin/name/DirectoryFontLoader.qml.tpl",
"target": "%{ProjectDirectory}/imports/%{ImportModuleName}/DirectoryFontLoader.qml"
},
diff --git a/share/qtcreator/qmldesigner/studio_templates/projects/application/wizard.json b/share/qtcreator/qmldesigner/studio_templates/projects/application/wizard.json
index 0708838a5a..2c5d606750 100644
--- a/share/qtcreator/qmldesigner/studio_templates/projects/application/wizard.json
+++ b/share/qtcreator/qmldesigner/studio_templates/projects/application/wizard.json
@@ -381,6 +381,14 @@
"target": "%{ProjectDirectory}/imports/%{ImportModuleName}/Constants.qml"
},
{
+ "source": "../shared-plugin/name/DataStore.json.tpl",
+ "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/DataStore.json"
+ },
+ {
+ "source": "../shared-plugin/name/DataStore.qml.tpl",
+ "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/DataStore.qml"
+ },
+ {
"source": "../shared-plugin/name/DirectoryFontLoader.qml.tpl",
"target": "%{ProjectDirectory}/imports/%{ImportModuleName}/DirectoryFontLoader.qml"
},
diff --git a/share/qtcreator/qmldesigner/studio_templates/projects/desktop-launcher/wizard.json b/share/qtcreator/qmldesigner/studio_templates/projects/desktop-launcher/wizard.json
index 913eb0bf28..81bbcb73f2 100644
--- a/share/qtcreator/qmldesigner/studio_templates/projects/desktop-launcher/wizard.json
+++ b/share/qtcreator/qmldesigner/studio_templates/projects/desktop-launcher/wizard.json
@@ -368,6 +368,14 @@
"target": "%{ProjectDirectory}/imports/%{ImportModuleName}/Constants.qml"
},
{
+ "source": "../shared-plugin/name/DataStore.json.tpl",
+ "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/DataStore.json"
+ },
+ {
+ "source": "../shared-plugin/name/DataStore.qml.tpl",
+ "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/DataStore.qml"
+ },
+ {
"source": "../shared-plugin/name/DirectoryFontLoader.qml.tpl",
"target": "%{ProjectDirectory}/imports/%{ImportModuleName}/DirectoryFontLoader.qml"
},
diff --git a/share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/CMakeLists.importmodule.txt.tpl b/share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/CMakeLists.importmodule.txt.tpl
index 517b91355a..5606f3c7b1 100644
--- a/share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/CMakeLists.importmodule.txt.tpl
+++ b/share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/CMakeLists.importmodule.txt.tpl
@@ -13,6 +13,7 @@ qt6_add_qml_module(%{ImportModuleName}
RESOURCE_PREFIX "/qt/qml"
QML_FILES
Constants.qml
+ DataStore.qml
DirectoryFontLoader.qml
EventListModel.qml
EventListSimulator.qml
diff --git a/share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/DataStore.json.tpl b/share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/DataStore.json.tpl
new file mode 100644
index 0000000000..8ebda6fb7e
--- /dev/null
+++ b/share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/DataStore.json.tpl
@@ -0,0 +1,30 @@
+{
+ "book": [
+ {
+ "author": "Nigel Rees",
+ "category": "reference",
+ "price": 8.95,
+ "title": "Sayings of the Century"
+ },
+ {
+ "author": "Evelyn Waugh",
+ "category": "fiction",
+ "price": 12.99,
+ "title": "Sword of Honor"
+ },
+ {
+ "author": "Herman Melville",
+ "category": "fiction",
+ "isbn": "0-553-21311-3",
+ "price": 8.99,
+ "title": "Moby Dick"
+ },
+ {
+ "author": "J. R. R. Tolkien",
+ "category": "fiction",
+ "isbn": "0-395-19395-8",
+ "price": 22.99,
+ "title": "The Lord of the Rings"
+ }
+ ]
+}
diff --git a/share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/DataStore.qml.tpl b/share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/DataStore.qml.tpl
new file mode 100644
index 0000000000..0f9c24373c
--- /dev/null
+++ b/share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/DataStore.qml.tpl
@@ -0,0 +1,12 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
+
+pragma Singleton
+import QtQuick.Studio.Utils
+
+JsonListModel {
+ property alias allModels: models
+ id: models
+
+ source: Qt.resolvedUrl("DataStore.json")
+}
diff --git a/share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/importmodule.qmldir.tpl b/share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/importmodule.qmldir.tpl
index d374931eab..a0ec2f17cf 100644
--- a/share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/importmodule.qmldir.tpl
+++ b/share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/importmodule.qmldir.tpl
@@ -1,6 +1,6 @@
Module %{ImportModuleName}
+singleton DataStore 1.0 DataStore.qml
singleton Constants 1.0 Constants.qml
EventListSimulator 1.0 EventListSimulator.qml
EventListModel 1.0 EventListModel.qml
DirectoryFontLoader 1.0 DirectoryFontLoader.qml
-
diff --git a/share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/qmldir b/share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/qmldir
index 3ba5adcc64..b5924a433c 100644
--- a/share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/qmldir
+++ b/share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/qmldir
@@ -1,4 +1,5 @@
singleton Constants 1.0 Constants.qml
+singleton DataStore 1.0 DataStore.qml
EventListModel 1.0 EventListModel.qml
EventListSimulator 1.0 EventListSimulator.qml
DirectoryFontLoader 1.0 DirectoryFontLoader.qml
diff --git a/share/qtcreator/templates/wizards/projects/qtquickapplication/wizard.json b/share/qtcreator/templates/wizards/projects/qtquickapplication/wizard.json
index 2e885c2bb6..64502bd124 100644
--- a/share/qtcreator/templates/wizards/projects/qtquickapplication/wizard.json
+++ b/share/qtcreator/templates/wizards/projects/qtquickapplication/wizard.json
@@ -243,6 +243,16 @@
"condition": "%{QdsProjectStyle}"
},
{
+ "source": "%{QdsWizardPath}/shared-plugin/name/DataStore.json.tpl",
+ "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/DataStore.json",
+ "condition": "%{QdsProjectStyle}"
+ },
+ {
+ "source": "%{QdsWizardPath}/shared-plugin/name/DataStore.qml.tpl",
+ "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/DataStore.qml",
+ "condition": "%{QdsProjectStyle}"
+ },
+ {
"source": "%{QdsWizardPath}/shared-plugin/name/DirectoryFontLoader.qml.tpl",
"target": "%{ProjectDirectory}/imports/%{ImportModuleName}/DirectoryFontLoader.qml",
"condition": "%{QdsProjectStyle}"