ExtensionSystem: Deprecate IPlugin::createTestObjects

The recommended replacement is to use addTest().

Change-Id: Id655cb8a55a581925c2437a5b8f74484532392ad
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
hjk
2023-02-09 15:29:21 +01:00
parent 47cdeb779a
commit ce6e5acea7
2 changed files with 9 additions and 11 deletions

View File

@@ -197,9 +197,12 @@ bool IPlugin::initialize(const QStringList &arguments, QString *errorString)
/*!
Registers a function object that creates a test object.
The ownership of the created object is transferred to the plugin.
The created objects are meant to be passed on to \l QTest::qExec().
\sa createTestObjects()
The function objects will be called if the user starts \QC with
\c {-test PluginName} or \c {-test all}.
The ownership of the created object is transferred to the plugin.
*/
void IPlugin::addTestCreator(const TestCreator &creator)
@@ -208,15 +211,7 @@ void IPlugin::addTestCreator(const TestCreator &creator)
}
/*!
Returns objects that are meant to be passed on to \l QTest::qExec().
This function will be called if the user starts \QC with
\c {-test PluginName} or \c {-test all}.
By default, this function creates test objects using the functors
added by \c addTest().
The ownership of returned objects is transferred to caller.
\deprecated [10.0] Use addTest() instead
\sa addTest()
*/

View File

@@ -33,6 +33,9 @@ public:
virtual QObject *remoteCommand(const QStringList & /* options */,
const QString & /* workingDirectory */,
const QStringList & /* arguments */) { return nullptr; }
// Deprecated in 10.0, use addTest()
virtual QVector<QObject *> createTestObjects() const;
protected: