diff options
author | Thomas Hartmann <Thomas.Hartmann@theqtcompany.com> | 2016-07-12 17:32:57 +0200 |
---|---|---|
committer | Thomas Hartmann <Thomas.Hartmann@theqtcompany.com> | 2016-07-13 11:51:26 +0000 |
commit | 64dfb6f0e18378af16ee23c00c58d1964584ddb6 (patch) | |
tree | f9443ac3b00179be1845d724f3d91b5a7a4cc213 /tests | |
parent | 339327f7a31dff63587db8939732ced9e01008a5 (diff) | |
download | qt-creator-64dfb6f0e18378af16ee23c00c58d1964584ddb6.tar.gz |
QmlDesigner.Tests: Fix loadGradient()
The order of nodes from directSubModelNodes() was not defined,
since we collect the nodes from different properties ("default/data"
and "gradient").
If we use the interface of NodeListProperty and explicitly
use the default property, then the order is defined.
Change-Id: I7982fa7749d1795ad39a7b76792ad794e49fa9ea
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp b/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp index 7b5c93e500..4953895df6 100644 --- a/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp +++ b/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp @@ -7800,7 +7800,9 @@ void tst_TestCore::loadGradient() { QCOMPARE(rootModelNode.directSubModelNodes().count(), 2); - ModelNode gradientNode = rootModelNode.directSubModelNodes().last(); + QVERIFY(rootModelNode.defaultNodeListProperty().isValid()); + QCOMPARE(rootModelNode.defaultNodeListProperty().toModelNodeList().count(), 1); + ModelNode gradientNode = rootModelNode.defaultNodeListProperty().toModelNodeList().first(); QVERIFY(gradientNode.isValid()); QVERIFY(!gradientNode.metaInfo().isSubclassOf("QtQuick.Item", -1, -1)); QCOMPARE(gradientNode.type(), QmlDesigner::TypeName("QtQuick.Gradient")); |