aboutsummaryrefslogtreecommitdiffstats
path: root/doc/qtcreator/src/projects/creator-only/creator-projects-custom-wizards.qdoc
blob: 56a54a26601531df6fdbe1a16aa57cfd30ef3c97 (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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
/****************************************************************************
**
** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Creator documentation.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of
** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
**
****************************************************************************/

// **********************************************************************
// NOTE: the sections are not ordered by their logical order to avoid
// reshuffling the file each time the index order changes (i.e., often).
// Run the fixnavi.pl script to adjust the links to the index order.
// **********************************************************************

/*!
    \contentspage index.html
    \previouspage creator-project-qmake-libraries.html
    \page creator-project-wizards.html
    \nextpage creator-version-control.html

    \title Adding New Custom Wizards

    If you have a team working on a large application or several applications,
    you might want to standardize the way the team members create projects and
    files.

    You can create custom wizards in JSON format. They are stored in wizard
    template directories that contain a JSON configuration file called
    \c {wizard.json} and any template files needed. The configuration file
    contains sections that specify information about the wizard, variables
    that you can use, wizard pages, and generators for creating files.

    To create a customized wizard, copy a template directory to the shared
    directory or the local user's settings directory under a new name. Then
    change the wizard id in the \c {wizard.json} file.

    You can create a subdirectory for the templates in the settings directory.
    The standard wizards are organized into subdirectories by type, but you can
    add your wizard directory to any directory you like. The folder hierarchy
    does not affect the order in which the wizards are displayed.

    To share the wizard with other users, you can create an archive of the
    wizard directory and instruct the recipients to extract it into one of the
    directories \QC searches wizards from.

    \QC displays the wizards that it finds in the
    \uicontrol {New File or Project} dialog. For each wizard, an icon (1), a
    display name (2), and a description (3) are displayed.

    \image qtcreator-custom-wizard.png

    \section1 Wizard Types

    In a project wizard, you can specify the files needed in a project.
    You can add wizard pages to allow developers to specify settings for the
    project.

    A file wizard is similar, but does not contain any project file.

    \section1 Locating Wizards

    \QC searches the following locations for wizards:

    \list

        \li Shared directory:
            \list
                \li On Windows: \c {share\qtcreator\templates\wizards}
                \li On Linux: \c {share/qtcreator/templates/wizards}
                \li On \macos:
                    \c{Qt Creator.app/Contents/Resources/templates/wizards}
            \endlist
        \li Local user's settings directory:
            \list
                \li On Windows:
                    \c {%APPDATA%\QtProject\qtcreator\templates\wizards}
                \li On Linux and \macos:
                    \c {$HOME/.config/QtProject/qtcreator/templates/wizards}
            \endlist
    \endlist

    \section1 Tips for Wizard Development

    Assign keyboard shortcuts to some helper actions and turn on verbose output.

    \section2 Mapping Actions to Keyboard Shortcuts

    \QC has some actions that can improve the wizard development process. These
    are by default not bound to any keyboard shortcuts and can thus not be
    triggered. To enable them, assign keyboard shortcuts in \uicontrol Tools >
    \uicontrol Options > \uicontrol Environment > \uicontrol Keyboard >
    \uicontrol Wizard.

    The following actions can help with wizard development:

    \table
        \header
            \li Action Id
            \li Description

        \row
            \li \uicontrol Inspect
            \li Triggering this action opens a window that lists all the
                defined fields and variables in the wizard at the time the
                action was triggered. Each activation of this action opens a
                new non-modal window, so you can compare state at different
                pages of the wizard for example.

        \row
            \li \uicontrol {Factory.Reset}
            \li Triggering this action makes \QC forget all wizard factories,
                causing it to reload all wizard definitions when for example
                opening \uicontrol File > \uicontrol {New File or Project}.
                This way you can avoid having to restart \QC for your changes to
                a wizard definition to become visible.
    \endtable

    \section2 Verbose Output

    For wizard development, we recommend that you start \QC with the
    \c {-customwizard-verbose} argument to receive confirmation that \QC was
    able to find and parse the \c {wizard.json} file. The verbose mode displays
    information about syntax errors, which are the most typical errors you might
    run into while editing wizards.

    In verbose mode, each correctly set up wizard produces output along the
    following lines:

    \code
    Checking "/home/jsmith/.config/QtProject/qtcreator/templates/wizards/mywizard"
    for wizard.json.
    * Configuration found and parsed.
    \endcode

    The output includes the name of the directory that was checked for a
    \c wizard.json file. If the file is not found, the message is not displayed.

    If the file contains errors, such as an invalid icon path, the following
    types of messages are displayed:

    \code
    Checking "/home/jsmith/.config/QtProject/qtcreator/templates/wizards/mywizard"
    for wizard.json.
    * Configuration found and parsed.
    * Failed to create: Icon file
    "/home/jsmith/.config/QtProject/qtcreator/templates/wizards/mywizard/../..
    /global/genericfilewizard.png" not found.
    \endcode

    See \l{Using Command Line Options} for more information about command line
    arguments.

    \include creator-projects-custom-wizards-json.qdocinc json wizards
*/