QmlDesigner: Enforce rules for QML component names

Since a QML component is generated from the effect,
the same rules for names should apply.

(cherry picked from commit 318a2aff2f)

Task-number: QDS-8152
Change-Id: I607c2771401fec2259b1e1aac9a37707aa1328b7
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Thomas Hartmann
2022-11-03 00:23:06 +01:00
committed by Tim Jenssen
parent 9269fb2d95
commit c299d95ea7

View File

@@ -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
}
}