aboutsummaryrefslogtreecommitdiffstats
path: root/share/qtcreator/templates/wizards/classes/python/wizard.json
blob: aeebd1f2a303539de2fb21a538a58cd2e4c7c77b (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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
{
    "version": 1,
    "supportedProjectTypes": [ ],
    "id": "P.PyClass",
    "category": "U.Python",
    "trDescription": "Creates new Python class file.",
    "trDisplayName": "Python Class",
    "trDisplayCategory": "Python",
    "icon": "../../files/python/icon.png",
    "enabled": "%{JS: value('Plugins').indexOf('Python') >= 0}",

    "options":
    [
        { "key": "Base", "value":"%{JS: value('BaseCB') === '' ? value('BaseEdit') : value('BaseCB')}" },
        { "key": "Imports", "value": "%{ImportQtCore}%{ImportQtWidgets}%{ImportQtDeclarative}"}
    ],

    "pages":
    [
        {
            "trDisplayName": "Define Class",
            "trShortTitle": "Details",
            "typeId": "Fields",
            "data" :
            [
                {
                    "name": "Class",
                    "trDisplayName": "Class name:",
                    "mandatory": true,
                    "type": "LineEdit",
                    "data": { "validator": "^(?:[^\\d\\W]\\w*|)$" }
                },
                {
                    "name": "Module",
                    "trDisplayName": "Python module:",
                    "type": "ComboBox",
                    "data":
                    {
                        "items": ["PySide2", "PyQt5"]
                    }
                },
                {
                    "name": "BaseCB",
                    "trDisplayName": "Base class:",
                    "type": "ComboBox",
                    "data":
                    {
                        "items": [ { "trKey": "<Custom>", "value": "" },
                                   "QObject", "QWidget", "QMainWindow", "QDeclarativeItem", "QQuickItem" ]
                    }
                },
                {
                    "name": "BaseEdit",
                    "type": "LineEdit",
                    "enabled": "%{JS: value('BaseCB') === ''}",
                    "mandatory": false,
                    "data": { "trText": "%{BaseCB}" }
                },



                {
                    "name": "Sp1",
                    "type": "Spacer"
                },
                {
                    "name": "ImportQtCore",
                    "trDisplayName": "Import QtCore",
                    "type": "CheckBox",
                    "data":
                    {
                        "checkedValue": "QtCore",
                        "uncheckedValue": "",
                        "checked": "%{JS: value('Base') !== ''}"
                    }
                },
                {
                    "name": "ImportQWidget",
                    "trDisplayName": "Import QtWidgets",
                    "type": "CheckBox",
                    "data":
                    {
                        "checkedValue": "QtWidgets",
                        "uncheckedValue": "",
                        "checked": "%{JS: value('Base') === 'QWidget'}"
                    }
                },
                {
                    "name": "ImportQtQuick",
                    "trDisplayName": "Import QtQuick",
                    "type": "CheckBox",
                    "data":
                    {
                        "checkedValue": "QtQuick",
                        "uncheckedValue": "",
                        "checked": "%{JS: value('Base') === 'QQuickItem'}"
                    }
                },
                {
                    "name": "Sp2",
                    "type": "Spacer"
                },



                {
                    "name": "FileName",
                    "type": "LineEdit",
                    "trDisplayName": "Source file:",
                    "mandatory": true,
                    "data": { "trText": "%{JS: Util.fileName(value('Class'), Util.preferredSuffix('text/x-python'))}" }
                },
                {
                    "name": "TargetPath",
                    "type": "PathChooser",
                    "trDisplayName": "Path:",
                    "mandatory": true,
                    "data":
                    {
                        "kind": "directory",
                        "basePath": "%{InitialPath}",
                        "path": "%{InitialPath}"
                    }
                }
            ]
        },
        {
            "trDisplayName": "Project Management",
            "shortTitle": "Summary",
            "typeId": "Summary"
        }
    ],

    "generators":
    [
        {
            "typeId": "File",
            "data":
            {
                "source": "file.py",
                "target": "%{FileName}",
                "openInEditor": true
            }
        }
    ]
}