summaryrefslogtreecommitdiff
path: root/share/qtcreator/qmldesigner/studio_templates/files/qtuiquickform/wizard.json
blob: 26c628f4b313da4ebaa0ee57b6127e2b18a72654 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
{
    "version": 1,
    "supportedProjectTypes": [ ],
    "id": "Q.QtStudio.QmlUIForm.2",
    "category": "B.StudioQtQuickFiles",
    "trDescription": "Creates a UI file (.ui.qml) along with a matching QML file for implementation purposes.",
    "trDisplayName": "QtQuick UI Form",
    "trDisplayCategory": "Qt Quick Files",
    "icon": "file_ui.png",
    "platformIndependent": true,

    "enabled": "%{JS: value('Plugins').indexOf('QmlJSEditor') >= 0}",
    "options" : [
        { "key": "QmlFile", "value": "%{Class}.%{JS: Util.preferredSuffix('text/x-qml')}" },
        { "key": "UiFile", "value": "%{FormClass}.%{JS: Util.preferredSuffix('application/x-qt.ui+qml')}" },
        { "key": "ApplicationImport", "value": "%{QmlProjectName} 1.0" },
        { "key": "RootItem", "value": "%{JS: %{RootItemCB}.RootItem}" },
        { "key": "UseImportDefault", "value": "%{JS: false}" },
        { "key": "UseQtQuickControls2Default", "value": "%{JS: true}" }
    ],
    "pages" :
    [
        {
            "trDisplayName": "Define Class",
            "trShortTitle": "Details",
            "typeId": "Fields",
            "data" :
            [
                {
                    "name": "Class",
                    "trDisplayName": "Component name:",
                    "mandatory": true,
                    "type": "LineEdit",
                    "data": {
                        "validator": "(?:[A-Z_][a-zA-Z_0-9]*|)",
                        "fixup": "%{JS: '%{INPUT}'.charAt(0).toUpperCase() + '%{INPUT}'.slice(1) }"
                    }
                },
                {
                    "name": "Sp1",
                    "type": "Spacer",
                    "data": { "factor": 2 }
                },
                {
                    "name": "FormClass",
                    "trDisplayName": "Component form name:",
                    "mandatory": true,
                    "type": "LineEdit",
                    "data": {
                        "validator": "(?:[A-Z_][a-zA-Z_0-9]*|)",
                        "fixup": "%{JS: '%{INPUT}'.charAt(0).toUpperCase() + '%{INPUT}'.slice(1) }",
                        "trText": "%{Class}Form"
                    }
                },
                {
                    "name": "TargetPath",
                    "type": "PathChooser",
                    "trDisplayName": "Path:",
                    "mandatory": true,
                    "data":
                    {
                        "kind": "directory",
                        "basePath": "%{InitialPath}",
                        "path": "%{InitialPath}"
                    }
                },
                {
                    "name": "RootItemCB",
                    "trDisplayName": "Root Item:",
                    "type": "ComboBox",
                    "data":
                    {
                        "index": 0,
                        "items":
                            [
                            {
                                "trKey": "Item",
                                "value":
                                "({
                                    'RootItem': 'Item'
                                })"
                            },
                            {
                                "trKey": "Rectangle",
                                "value":
                                "({
                                    'RootItem': 'Rectangle'
                                })"
                            }
                        ]
                    }
                },
                {
                    "name": "UseImport",
                    "trDisplayName": "Use Application Import",
                    "type": "CheckBox",
                    "data":
                    {
                        "checked": "%{UseImportDefault}"
                    }
                },
                {
                    "name": "UseQtQuickControls2",
                    "trDisplayName": "Use QtQuick Controls 2",
                    "type": "CheckBox",
                    "data":
                    {
                        "checked": "%{UseQtQuickControls2Default}"
                    }
                }
            ]
        }
    ],
    "generators" :
    [
        {
            "typeId": "File",
            "data": [
                {
                    "source": "file.qml.tpl",
                    "target": "%{TargetPath}/%{QmlFile}",
                    "openInEditor": true
                },
                {
                    "source": "fileForm.ui.qml.tpl",
                    "target": "%{TargetPath}/%{UiFile}",
                    "openInEditor": true
                }
            ]
        }
    ]
}