32
32
Implementing wizards requires:
34
\o Deciding on a base class:
34
\li Deciding on a base class:
36
\o Core::IWizard is a very generic interface that does
37
not make any assumption about what the wizard does and
38
what its UI looks like.
36
\li Core::IWizard is a very generic interface that does
37
not make any assumption about what the wizard does and
38
what its UI looks like.
40
\o Core::BaseFileWizard should be used for wizards that
41
generate files using a UI based on Utils::Wizard.
40
\li Core::BaseFileWizard should be used for wizards that
41
generate files using a UI based on Utils::Wizard.
44
\o Providing a set of parameters that determine how the wizard shows up
45
in the list of wizards in the \gui{New File or Project} dialog.
47
When deriving from Core::IWizard, virtual functions returning the
48
values have to be implemented.
50
When deriving from Core::BaseFileWizard, a parameter class
51
Core::BaseFileWizardParameters needs to be passed to the constructor,
52
on which the parameters can be set. This allows for easy creation
53
of several wizard instances with slightly different parameters.
55
\o Implementing the wizard UI
57
Typically, this will be a class derived from Utils::Wizard.
58
Utils::Wizard extends QWizard with the functionality to show a progress
61
\o Implementing the wizard functionality
63
When deriving from Core::BaseFileWizard, a list of Core::GeneratedFile
64
needs to be populated with the files and their contents.
65
\note The files are not actually written to the disk. This will be
66
done by Core::BaseFileWizard after performing overwrite checks and prompting
44
\li Providing a set of parameters that determine how the wizard shows up
45
in the list of wizards in the \gui{New File or Project} dialog.
47
When deriving from Core::IWizard, virtual functions returning the
48
values have to be implemented.
50
When deriving from Core::BaseFileWizard, a parameter class
51
Core::BaseFileWizardParameters needs to be passed to the constructor,
52
on which the parameters can be set. This allows for easy creation
53
of several wizard instances with slightly different parameters.
55
\li Implementing the wizard UI
57
Typically, this will be a class derived from Utils::Wizard.
58
Utils::Wizard extends QWizard with the functionality to show a progress
61
\li Implementing the wizard functionality
63
When deriving from Core::BaseFileWizard, a list of Core::GeneratedFile
64
needs to be populated with the files and their contents.
65
\note The files are not actually written to the disk. This will be
66
done by Core::BaseFileWizard after performing overwrite checks and prompting
80
\o Qt Creator wizard interface, implementations of which are registered with
81
ExtensionSystem::PluginManager.
84
\o Core::BaseFileWizard
85
\o Inherits Core::IWizard and provides a base class for generating files with a UI
89
\o Core::BaseFileWizardParameters
90
\o Contains parameters for Core::BaseFileWizard.
93
\o Core::GeneratedFile
94
\o A file as produced by Core::BaseFileWizard, containing name, contents and some
98
\o Utils::FileWizardPage
99
\o Introductory wizard page asking for file name and path.
102
\o Utils::FileWizardDialog
103
\o A wizard dialog presenting a Utils::FileWizardPage, which can be extended
107
\o Utils::ProjectIntroPage
108
\o Introductory wizard page asking for project name and path.
111
\o ProjectExplorer::BaseProjectWizardDialog
112
\o Base class for project wizard dialogs, presenting
80
\li Qt Creator wizard interface, implementations of which are registered with
81
ExtensionSystem::PluginManager.
84
\li Core::BaseFileWizard
85
\li Inherits Core::IWizard and provides a base class for generating files with a UI
89
\li Core::BaseFileWizardParameters
90
\li Contains parameters for Core::BaseFileWizard.
93
\li Core::GeneratedFile
94
\li A file as produced by Core::BaseFileWizard, containing name, contents and some
98
\li Utils::FileWizardPage
99
\li Introductory wizard page asking for file name and path.
102
\li Utils::FileWizardDialog
103
\li A wizard dialog presenting a Utils::FileWizardPage, which can be extended
107
\li Utils::ProjectIntroPage
108
\li Introductory wizard page asking for project name and path.
111
\li ProjectExplorer::BaseProjectWizardDialog
112
\li Base class for project wizard dialogs, presenting
113
113
a Utils::ProjectIntroPage.
131
\o Core::IWizard::WizardKind
133
\o Enumeration value that indicates the type of the wizard (project, class, file).
148
\o Name to be shown in the list.
153
\o Unique identifier for the wizard. It also determines the order within a category.
158
\o Identifier of the category under which the wizard is to be listed. It also
159
determines the order of the categories.
131
\li Core::IWizard::WizardKind
133
\li Enumeration value that indicates the type of the wizard (project, class, file).
143
\li Descriptive text.
148
\li Name to be shown in the list.
153
\li Unique identifier for the wizard. It also determines the order within a category.
158
\li Identifier of the category under which the wizard is to be listed. It also
159
determines the order of the categories.
164
\o Description of the category.
164
\li Description of the category.
167
167
\section1 Example