diff options
author | Thomas Hartmann <thomas.hartmann@qt.io> | 2022-11-03 00:23:06 +0100 |
---|---|---|
committer | Tim Jenssen <tim.jenssen@qt.io> | 2022-11-04 16:46:29 +0000 |
commit | c299d95ea7204f0716b6f464c9a92e187a7f31a2 (patch) | |
tree | 5436fd4428d875fab0e46a8538d3f637d40ad221 | |
parent | 9269fb2d950b4ae06cd35f4eb61e1d3290367089 (diff) | |
download | qt-creator-c299d95ea7204f0716b6f464c9a92e187a7f31a2.tar.gz |
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 318a2aff2f21b03ba7564055f168095101269cb8)
Task-number: QDS-8152
Change-Id: I607c2771401fec2259b1e1aac9a37707aa1328b7
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
-rw-r--r-- | share/qtcreator/qmldesigner/studio_templates/files/effect/wizard.json | 41 |
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 } } |