IWizardFactory Classclass Core::IWizardFactory
The IWizardFactory class is the base class for all wizard factories. More...
|Utils::Wizard *||runWizard(const QString &path, QWidget *parent, Utils::Id platform, const QVariantMap &variables)|
Note: Instead of using this class, we recommend that you create JSON-based wizards, as instructed in Adding New Custom Wizards.
The wizard interface is a very thin abstraction for the wizards in File > New File or Project. Basically, it defines what to show to the user in the wizard selection dialogs, and a hook that is called if the user selects the wizard.
Wizards can then perform any operations they like, including showing dialogs and creating files. Often it is not necessary to create your own wizard from scratch. Use one of the predefined wizards and adapt it to your needs.
To make your wizard known to the system, add your IWizardFactory instance to the plugin manager's object pool in your plugin's initialize function:
Member Type Documentation
Used to specify what kind of objects the wizard creates. This information is used to show e.g. only wizards that create projects when selecting a New Project menu item.
|The wizard creates one or more files.|
|The wizard creates a new project.|
Member Function Documentation
QString IWizardFactory::category() const
Returns a category ID to add the wizard to.
QString IWizardFactory::description() const
Returns a translated description to show when this wizard is selected in the dialog.
QString IWizardFactory::displayCategory() const
Returns the translated string of the category, how it should appear in the dialog.
QString IWizardFactory::displayName() const
Returns the translated name of the wizard, how it should appear in the dialog.
QIcon IWizardFactory::icon() const
Returns an icon to show in the wizard selection dialog.
Returns an arbitrary id that is used for sorting within the category.
Core::IWizardFactory::WizardKind IWizardFactory::kind() const
Returns what kind of objects are created by the wizard.
Utils::Wizard *IWizardFactory::runWizard(const QString &path, QWidget *parent, Utils::Id platform, const QVariantMap &variables)
Creates the wizard that the user selected for execution on the operating system platform with variables.
Any dialogs the wizard opens should use the given parent. The path argument is a suggestion for the location where files should be created. The wizard should fill this in its path selection elements as a default path.
© 2020 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.