summaryrefslogtreecommitdiff
path: root/src/plugins/coreplugin/iwizardfactory.h
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@theqtcompany.com>2015-05-22 17:16:36 +0200
committerTobias Hunger <tobias.hunger@theqtcompany.com>2015-05-26 11:47:53 +0000
commit25f2f8e1ee43c2656a9c273f541a3735a7841273 (patch)
tree1cf4d8c6765c3e29d232112fe38f54b1519797a8 /src/plugins/coreplugin/iwizardfactory.h
parentb5e3f2e57b38e0d3476da969b093aa36ebb61e3e (diff)
downloadqt-creator-25f2f8e1ee43c2656a9c273f541a3735a7841273.tar.gz
IWizardFactory: Create wizards with factoryCreators
Do not use the object pool to hold potential wizards. Register FactoryCreator functions with IWizardFactory instead and use those to create the wizards when necessary. This saves us a couple of cycles during startup since we can now delay construction of all wizards and it makes us more flexible wrt. managing the lifecycle of the wizard factories. Change-Id: I95d6a6dfcdf0fd995e1934a9fefcd96c6a676753 Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Diffstat (limited to 'src/plugins/coreplugin/iwizardfactory.h')
-rw-r--r--src/plugins/coreplugin/iwizardfactory.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/plugins/coreplugin/iwizardfactory.h b/src/plugins/coreplugin/iwizardfactory.h
index df5a4e8139..0d52a0e54a 100644
--- a/src/plugins/coreplugin/iwizardfactory.h
+++ b/src/plugins/coreplugin/iwizardfactory.h
@@ -38,6 +38,8 @@
#include <QObject>
#include <QString>
+#include <functional>
+
namespace Core {
namespace Internal { class CorePlugin; }
@@ -87,6 +89,9 @@ public:
bool isAvailable(const QString &platformName) const;
QStringList supportedPlatforms() const;
+ typedef std::function<QList<IWizardFactory *>()> FactoryCreator;
+ static void registerFactoryCreator(const FactoryCreator &creator);
+
// Utility to find all registered wizards
static QList<IWizardFactory*> allWizardFactories();
// Utility to find all registered wizards of a certain kind
@@ -100,6 +105,7 @@ protected:
FeatureSet pluginFeatures() const;
private:
+ static void initialize();
static void destroyFeatureProvider();
IWizardFactory::WizardKind m_kind;