summaryrefslogtreecommitdiff
path: root/share/qtcreator/templates/wizards/projects/qtforpythonapplication/mainwindow/wizard.json
blob: c8e397d0d82a9064390724a334b6fc76df7050bc (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
{
    "version": 1,
    "supportedProjectTypes": [ "Qt4ProjectManager.Qt4Project" ],
    "id": "U.QtForPythonApplicationWindow",
    "category": "F.Application",
    "trDescription": "Creates a Qt for Python application that contains an empty window.",
    "trDisplayName": "Qt for Python - Window",
    "trDisplayCategory": "Application",
    "icon": "icon.png",
    "enabled": "%{JS: value('Plugins').indexOf('PythonEditor') >= 0}",
    "featuresRequired": [ "QtSupport.Wizards.FeatureQt.5.6" ],

    "options":
    [
        { "key": "MainPyFileName", "value": "%{ProjectDirectory}/%{SrcFileName}" },
        { "key":  "PyProjectFile", "value": "%{ProjectDirectory}/%{ProjectFileName}" }
    ],

    "pages":
    [
        {
            "trDisplayName": "Project Location",
            "trShortTitle": "Location",
            "typeId": "Project",
            "name": "ProjectPath"
        },
        {
            "trDisplayName": "Define Class",
            "trShortTitle": "Details",
            "typeId": "Fields",
            "data" :
            [
                {
                    "name": "Class",
                    "trDisplayName": "Class name:",
                    "mandatory": true,
                    "type": "LineEdit",
                    "data": { "validator": "(?:(?:[a-zA-Z_][a-zA-Z_0-9]*::)*[a-zA-Z_][a-zA-Z_0-9]*|)" }
                },
                {
                    "name": "BaseCB",
                    "trDisplayName": "Base class:",
                    "type": "ComboBox",
                    "data":
                    {
                        "items": [ { "trKey": "<Custom>", "value": "" },
                                   "QWidget", "QMainWindow"]
                    }
                },
                {
                    "name": "SrcFileName",
                    "type": "LineEdit",
                    "trDisplayName": "Source file:",
                    "mandatory": true,
                    "data": { "trText": "%{JS: Cpp.classToFileName(value('Class'), Util.preferredSuffix('text/x-python'))}" }
                },
                {
                    "name": "ProjectFileName",
                    "type": "LineEdit",
                    "trDisplayName": "Project file:",
                    "mandatory": true,
                    "data": { "trText": "%{JS: Cpp.classToFileName(value('Class'), 'pyproject')}" }
                }
            ]
        },
        {
            "trDisplayName": "Project Management",
            "trShortTitle": "Summary",
            "typeId": "Summary"
        }
    ],
    "generators":
    [
        {
            "typeId": "File",
            "data":
            [
                {
                    "source": "../main.pyproject",
                    "target": "%{PyProjectFile}",
                    "openAsProject": true
                },
                {
                    "source": "../main_mainwindow.py",
                    "target": "%{MainPyFileName}",
                    "openInEditor": true
                }
            ]
        }
    ]
}