aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Hartmann <thomas.hartmann@qt.io>2022-11-03 00:23:06 +0100
committerTim Jenssen <tim.jenssen@qt.io>2022-11-03 10:54:18 +0000
commit318a2aff2f21b03ba7564055f168095101269cb8 (patch)
treef1cfc3811e06661d3e776bc1f1c2970fb7daf28c
parent7b9303007a9f2aa9f31485f9802dd8a6aa2668ae (diff)
QmlDesigner: Enforce rules for QML component names
Since a QML component is generated from the effect, the same rules for names should apply. Task-number: QDS-8152 Change-Id: I607c2771401fec2259b1e1aac9a37707aa1328b7 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
-rw-r--r--share/qtcreator/qmldesigner/studio_templates/files/effect/wizard.json41
1 files changed, 33 insertions, 8 deletions
diff --git a/share/qtcreator/qmldesigner/studio_templates/files/effect/wizard.json b/share/qtcreator/qmldesigner/studio_templates/files/effect/wizard.json
index d922fb94a5..3dedbb5080 100644
--- a/share/qtcreator/qmldesigner/studio_templates/files/effect/wizard.json
+++ b/share/qtcreator/qmldesigner/studio_templates/files/effect/wizard.json
@@ -12,18 +12,43 @@
"featuresRequired": [ "QmlDesigner.Wizards.Enterprise" ],
"options": [
- { "key": "DefaultSuffix", "value": "qep" },
+ { "key": "EffectFile", "value": "%{Class}.qep" },
{ "key": "DoNotOpenFile", "value": "true" }
],
"pages" :
[
- {
- "trDisplayName": "Location",
- "trShortTitle": "Location",
- "typeId": "File"
- }
- ],
+ {
+ "trDisplayName": "Define Class",
+ "trShortTitle": "Details",
+ "typeId": "Fields",
+ "data" :
+ [
+ {
+ "name": "Class",
+ "trDisplayName": "Effect name:",
+ "mandatory": true,
+ "type": "LineEdit",
+ "data": {
+ "validator": "(?:[A-Z_][a-zA-Z_0-9]*|)",
+ "fixup": "%{JS: '%{INPUT}'.charAt(0).toUpperCase() + '%{INPUT}'.slice(1) }"
+ }
+ },
+ {
+ "name": "TargetPath",
+ "type": "PathChooser",
+ "trDisplayName": "Path:",
+ "mandatory": true,
+ "data":
+ {
+ "kind": "existingDirectory",
+ "basePath": "%{InitialPath}",
+ "path": "%{InitialPath}"
+ }
+ }
+ ]
+ }
+],
"generators" :
[
{
@@ -31,7 +56,7 @@
"data":
{
"source": "file.qep",
- "target": "%{JS: Util.fileName(value('TargetPath'), value('DefaultSuffix'))}",
+ "target": "%{TargetPath}/%{EffectFile}",
"openInEditor": false
}
}