diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2016-12-21 10:21:41 +0100 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2016-12-21 17:34:33 +0000 |
commit | 42c52e6f2d9002e8191ada765d8a2509c7fae71b (patch) | |
tree | bbd40a618190eb13a726098d18034602fda8875f /src/imports/testlib | |
parent | 312967965fed542c77ca6f2b03400296da342bd5 (diff) |
TestCase: make parent argument to createTemporaryObject optional
This matches the behavior seen from Component's createObject()
function.
Change-Id: I83fe73a588d04c5efd30c49059bb19e7584bef48
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'src/imports/testlib')
-rw-r--r-- | src/imports/testlib/TestCase.qml | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/imports/testlib/TestCase.qml b/src/imports/testlib/TestCase.qml index 1ead2f21b7..18c70e1169 100644 --- a/src/imports/testlib/TestCase.qml +++ b/src/imports/testlib/TestCase.qml @@ -567,7 +567,7 @@ Item { \qmlmethod object TestCase::createTemporaryObject(Component component, object parent, object properties) This function dynamically creates a QML object from the given - \a component with the specified \a parent and \a properties. + \a component with the specified optional \a parent and \a properties. The returned object will be destroyed (if it was not already) after \l cleanup() has finished executing, meaning that objects created with this function are guaranteed to be destroyed after each test, @@ -589,12 +589,6 @@ Item { throw new Error("QtQuickTest::fail"); } - if (!parent && parent !== null) { - qtest_results.fail("Second argument must be a parent object or null; actual type is " + typeof parent, - util.callerFile(), util.callerLine()); - throw new Error("QtQuickTest::fail"); - } - if (properties && typeof properties !== "object") { qtest_results.fail("Third argument must be an object; actual type is " + typeof properties, util.callerFile(), util.callerLine()); |