forked from qt-creator/qt-creator
ExtensionSystem: Use TestCreator in more places
Amends b59e632ac3
Change-Id: I11000c488c6a69b4c55b8ccb164fa6587abb8b5b
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -164,7 +164,7 @@ namespace Internal {
|
||||
class IPluginPrivate
|
||||
{
|
||||
public:
|
||||
QList<std::function<QObject *()>> testCreators;
|
||||
QList<TestCreator> testCreators;
|
||||
};
|
||||
|
||||
} // Internal
|
||||
|
||||
@@ -13,6 +13,8 @@ namespace ExtensionSystem {
|
||||
|
||||
namespace Internal { class IPluginPrivate; }
|
||||
|
||||
using TestCreator = std::function<QObject *()>;
|
||||
|
||||
class EXTENSIONSYSTEM_EXPORT IPlugin : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -41,7 +43,6 @@ public:
|
||||
protected:
|
||||
virtual void initialize() {}
|
||||
|
||||
using TestCreator = std::function<QObject *()>;
|
||||
template <typename Test, typename ...Args>
|
||||
void addTest(Args && ...args) { addTestCreator([args...] { return new Test(args...); }); }
|
||||
void addTestCreator(const TestCreator &creator);
|
||||
|
||||
@@ -78,7 +78,7 @@ public:
|
||||
PluginSpec::PluginArgumentDescriptions argumentDescriptions;
|
||||
IPlugin *plugin = nullptr;
|
||||
|
||||
QList<std::function<QObject *()>> registeredPluginTests;
|
||||
QList<TestCreator> registeredPluginTests;
|
||||
|
||||
PluginSpec::State state = PluginSpec::Invalid;
|
||||
bool hasError = false;
|
||||
|
||||
Reference in New Issue
Block a user