aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Hartmann <thomas.hartmann@qt.io>2023-11-23 15:40:38 +0100
committerThomas Hartmann <thomas.hartmann@qt.io>2023-11-24 11:49:23 +0000
commite2c1cfb69fb3fa9b0db13c27af07d30364872930 (patch)
tree43e75b6f8a6ac9fe2a6fe7279aa0f85c8e3e5ca4
parentac3a4b71e607caacdc0b0486056198880cf8b933 (diff)
QmlDesigner: Add wizard data for models and backend json data
Added the new files to all wizards, since the change of the qmldir file otherwise breaks the wizard. Adding json files to qmlproject for cmake generation. New files have to be added to cmakefiles.txt. Change-Id: If00eb4507b6f1364ce3cfa00db39632635febd09 Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io> Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
-rw-r--r--share/qtcreator/qmldesigner/studio_templates/projects/application-3d/wizard.json24
-rw-r--r--share/qtcreator/qmldesigner/studio_templates/projects/application/wizard.json24
-rw-r--r--share/qtcreator/qmldesigner/studio_templates/projects/common/app.qmlproject.tpl4
-rw-r--r--share/qtcreator/qmldesigner/studio_templates/projects/desktop-launcher/wizard.json24
-rw-r--r--share/qtcreator/qmldesigner/studio_templates/projects/mobile-scroll/wizard.json16
-rw-r--r--share/qtcreator/qmldesigner/studio_templates/projects/mobile-stack/wizard.json16
-rw-r--r--share/qtcreator/qmldesigner/studio_templates/projects/mobile-swipe/wizard.json16
-rw-r--r--share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/CMakeLists.importmodule.txt.tpl6
-rw-r--r--share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/DataStore.qml15
-rw-r--r--share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/JsonData.qml9
-rw-r--r--share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/data.json4
-rw-r--r--share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/importmodule.qmldir.tpl1
-rw-r--r--share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/models.json24
-rw-r--r--share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/qmldir1
-rw-r--r--share/qtcreator/templates/wizards/projects/qtquickapplication/wizard.json26
15 files changed, 175 insertions, 35 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 232dfd4319..cf30f9c91c 100644
--- a/share/qtcreator/qmldesigner/studio_templates/projects/application-3d/wizard.json
+++ b/share/qtcreator/qmldesigner/studio_templates/projects/application-3d/wizard.json
@@ -368,14 +368,6 @@
"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"
},
@@ -390,6 +382,22 @@
{
"source": "../shared-plugin/name/designer/plugin.metainfo",
"target": "%{ProjectDirectory}/imports/%{ImportModuleName}/designer/plugin.metainfo"
+ },
+ {
+ "source": "../shared-plugin/name/JsonData.qml",
+ "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/JsonData.qml"
+ },
+ {
+ "source": "../shared-plugin/name/DataStore.qml",
+ "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/DataStore.qml"
+ },
+ {
+ "source": "../shared-plugin/name/models.json",
+ "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/models.json"
+ },
+ {
+ "source": "../shared-plugin/name/data.json",
+ "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/data.json"
}
]
}
diff --git a/share/qtcreator/qmldesigner/studio_templates/projects/application/wizard.json b/share/qtcreator/qmldesigner/studio_templates/projects/application/wizard.json
index 2c5d606750..6fd0637fb1 100644
--- a/share/qtcreator/qmldesigner/studio_templates/projects/application/wizard.json
+++ b/share/qtcreator/qmldesigner/studio_templates/projects/application/wizard.json
@@ -381,14 +381,6 @@
"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"
},
@@ -403,6 +395,22 @@
{
"source": "../shared-plugin/name/designer/plugin.metainfo",
"target": "%{ProjectDirectory}/imports/%{ImportModuleName}/designer/plugin.metainfo"
+ },
+ {
+ "source": "../shared-plugin/name/JsonData.qml",
+ "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/JsonData.qml"
+ },
+ {
+ "source": "../shared-plugin/name/DataStore.qml",
+ "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/DataStore.qml"
+ },
+ {
+ "source": "../shared-plugin/name/models.json",
+ "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/models.json"
+ },
+ {
+ "source": "../shared-plugin/name/data.json",
+ "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/data.json"
}
]
}
diff --git a/share/qtcreator/qmldesigner/studio_templates/projects/common/app.qmlproject.tpl b/share/qtcreator/qmldesigner/studio_templates/projects/common/app.qmlproject.tpl
index 6169688f16..2a42e7222c 100644
--- a/share/qtcreator/qmldesigner/studio_templates/projects/common/app.qmlproject.tpl
+++ b/share/qtcreator/qmldesigner/studio_templates/projects/common/app.qmlproject.tpl
@@ -64,6 +64,10 @@ Project {
}
Files {
+ filter: "*.json"
+ }
+
+ Files {
filter: "*.mesh"
directory: "asset_imports"
}
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 81bbcb73f2..bb3e4851f9 100644
--- a/share/qtcreator/qmldesigner/studio_templates/projects/desktop-launcher/wizard.json
+++ b/share/qtcreator/qmldesigner/studio_templates/projects/desktop-launcher/wizard.json
@@ -368,14 +368,6 @@
"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"
},
@@ -390,6 +382,22 @@
{
"source": "../shared-plugin/name/designer/plugin.metainfo",
"target": "%{ProjectDirectory}/imports/%{ImportModuleName}/designer/plugin.metainfo"
+ },
+ {
+ "source": "../shared-plugin/name/JsonData.qml",
+ "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/JsonData.qml"
+ },
+ {
+ "source": "../shared-plugin/name/DataStore.qml",
+ "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/DataStore.qml"
+ },
+ {
+ "source": "../shared-plugin/name/models.json",
+ "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/models.json"
+ },
+ {
+ "source": "../shared-plugin/name/data.json",
+ "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/data.json"
}
]
}
diff --git a/share/qtcreator/qmldesigner/studio_templates/projects/mobile-scroll/wizard.json b/share/qtcreator/qmldesigner/studio_templates/projects/mobile-scroll/wizard.json
index 944b6b6289..104d349bcc 100644
--- a/share/qtcreator/qmldesigner/studio_templates/projects/mobile-scroll/wizard.json
+++ b/share/qtcreator/qmldesigner/studio_templates/projects/mobile-scroll/wizard.json
@@ -341,6 +341,22 @@
{
"source": "../shared-plugin/name/designer/plugin.metainfo",
"target": "%{ProjectDirectory}/imports/%{ImportModuleName}/designer/plugin.metainfo"
+ },
+ {
+ "source": "../shared-plugin/name/JsonData.qml",
+ "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/JsonData.qml"
+ },
+ {
+ "source": "../shared-plugin/name/DataStore.qml",
+ "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/DataStore.qml"
+ },
+ {
+ "source": "../shared-plugin/name/models.json",
+ "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/models.json"
+ },
+ {
+ "source": "../shared-plugin/name/data.json",
+ "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/data.json"
}
]
}
diff --git a/share/qtcreator/qmldesigner/studio_templates/projects/mobile-stack/wizard.json b/share/qtcreator/qmldesigner/studio_templates/projects/mobile-stack/wizard.json
index c8733770e0..d8758ca2bf 100644
--- a/share/qtcreator/qmldesigner/studio_templates/projects/mobile-stack/wizard.json
+++ b/share/qtcreator/qmldesigner/studio_templates/projects/mobile-stack/wizard.json
@@ -343,6 +343,22 @@
{
"source": "../shared-plugin/name/designer/plugin.metainfo",
"target": "%{ProjectDirectory}/imports/%{ImportModuleName}/designer/plugin.metainfo"
+ },
+ {
+ "source": "../shared-plugin/name/JsonData.qml",
+ "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/JsonData.qml"
+ },
+ {
+ "source": "../shared-plugin/name/DataStore.qml",
+ "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/DataStore.qml"
+ },
+ {
+ "source": "../shared-plugin/name/models.json",
+ "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/models.json"
+ },
+ {
+ "source": "../shared-plugin/name/data.json",
+ "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/data.json"
}
]
}
diff --git a/share/qtcreator/qmldesigner/studio_templates/projects/mobile-swipe/wizard.json b/share/qtcreator/qmldesigner/studio_templates/projects/mobile-swipe/wizard.json
index 295c85aa63..0661a77b7b 100644
--- a/share/qtcreator/qmldesigner/studio_templates/projects/mobile-swipe/wizard.json
+++ b/share/qtcreator/qmldesigner/studio_templates/projects/mobile-swipe/wizard.json
@@ -343,6 +343,22 @@
{
"source": "../shared-plugin/name/designer/plugin.metainfo",
"target": "%{ProjectDirectory}/imports/%{ImportModuleName}/designer/plugin.metainfo"
+ },
+ {
+ "source": "../shared-plugin/name/JsonData.qml",
+ "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/JsonData.qml"
+ },
+ {
+ "source": "../shared-plugin/name/DataStore.qml",
+ "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/DataStore.qml"
+ },
+ {
+ "source": "../shared-plugin/name/models.json",
+ "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/models.json"
+ },
+ {
+ "source": "../shared-plugin/name/data.json",
+ "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/data.json"
}
]
}
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 5606f3c7b1..3b74123f7b 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
@@ -11,10 +11,14 @@ qt6_add_qml_module(%{ImportModuleName}
URI "%{ImportModuleName}"
VERSION 1.0
RESOURCE_PREFIX "/qt/qml"
- QML_FILES
+ QML_FILES
Constants.qml
DataStore.qml
DirectoryFontLoader.qml
EventListModel.qml
EventListSimulator.qml
+ JsonData.qml
+ RESOURCES
+ data.json
+ models.json
)
diff --git a/share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/DataStore.qml b/share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/DataStore.qml
new file mode 100644
index 0000000000..32acc1d817
--- /dev/null
+++ b/share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/DataStore.qml
@@ -0,0 +1,15 @@
+pragma Singleton
+import QtQuick 6.5
+import QtQuick.Studio.Utils 1.0
+
+JsonListModel {
+ id: models
+ source: Qt.resolvedUrl("models.json")
+
+ property ChildListModel exampleModel: ChildListModel {
+ modelName: "exampleModel"
+ }
+
+ property JsonData backend: JsonData {}
+}
+
diff --git a/share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/JsonData.qml b/share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/JsonData.qml
new file mode 100644
index 0000000000..a49600e270
--- /dev/null
+++ b/share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/JsonData.qml
@@ -0,0 +1,9 @@
+import QtQuick 2.15
+import QtQuick.Controls 2.15
+import QtQuick.Studio.Utils 1.0
+
+JsonBackend {
+ property string name: "someName"
+ property int number: 1
+ source: Qt.resolvedUrl("data.json")
+}
diff --git a/share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/data.json b/share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/data.json
new file mode 100644
index 0000000000..71208c1808
--- /dev/null
+++ b/share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/data.json
@@ -0,0 +1,4 @@
+{
+ "name": "Christen Anderson",
+ "number": "+3455641"
+}
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 a0ec2f17cf..8f451c8494 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
@@ -4,3 +4,4 @@ singleton Constants 1.0 Constants.qml
EventListSimulator 1.0 EventListSimulator.qml
EventListModel 1.0 EventListModel.qml
DirectoryFontLoader 1.0 DirectoryFontLoader.qml
+singleton DataStore 1.0 DataStore.qml
diff --git a/share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/models.json b/share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/models.json
new file mode 100644
index 0000000000..17eb0e92b3
--- /dev/null
+++ b/share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/models.json
@@ -0,0 +1,24 @@
+{
+ "exampleModel": [
+ {
+ "name": "Christen Anderson",
+ "number": "+3455641"
+ },
+ {
+ "name": "Armanda Cox",
+ "number": "+21155641"
+ },
+ {
+ "name": "Ken Garza",
+ "number": "+3288642"
+ },
+ {
+ "name": "Rodney Hamilton",
+ "number": "+3558848"
+ },
+ {
+ "name": "Andrew Battles",
+ "number": "+42488649"
+ }
+ ]
+}
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 b5924a433c..d99371ee1d 100644
--- a/share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/qmldir
+++ b/share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/qmldir
@@ -3,3 +3,4 @@ singleton DataStore 1.0 DataStore.qml
EventListModel 1.0 EventListModel.qml
EventListSimulator 1.0 EventListSimulator.qml
DirectoryFontLoader 1.0 DirectoryFontLoader.qml
+singleton DataStore 1.0 DataStore.qml
diff --git a/share/qtcreator/templates/wizards/projects/qtquickapplication/wizard.json b/share/qtcreator/templates/wizards/projects/qtquickapplication/wizard.json
index 64502bd124..b1c8c5fb74 100644
--- a/share/qtcreator/templates/wizards/projects/qtquickapplication/wizard.json
+++ b/share/qtcreator/templates/wizards/projects/qtquickapplication/wizard.json
@@ -243,16 +243,6 @@
"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}"
@@ -271,6 +261,22 @@
"source": "%{QdsWizardPath}/shared-plugin/name/designer/plugin.metainfo",
"target": "%{ProjectDirectory}/imports/%{ImportModuleName}/designer/plugin.metainfo",
"condition": "%{QdsProjectStyle}"
+ },
+ {
+ "source": "../shared-plugin/name/JsonData.qml",
+ "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/JsonData.qml"
+ },
+ {
+ "source": "../shared-plugin/name/DataStore.qml",
+ "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/DataStore.qml"
+ },
+ {
+ "source": "../shared-plugin/name/models.json",
+ "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/models.json"
+ },
+ {
+ "source": "../shared-plugin/name/data.json",
+ "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/data.json"
}
]
}