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>
This commit is contained in:
Thomas Hartmann
2016-07-12 17:32:57 +02:00
parent 339327f7a3
commit 64dfb6f0e1

View File

@@ -7800,7 +7800,9 @@ void tst_TestCore::loadGradient()
{ {
QCOMPARE(rootModelNode.directSubModelNodes().count(), 2); 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.isValid());
QVERIFY(!gradientNode.metaInfo().isSubclassOf("QtQuick.Item", -1, -1)); QVERIFY(!gradientNode.metaInfo().isSubclassOf("QtQuick.Item", -1, -1));
QCOMPARE(gradientNode.type(), QmlDesigner::TypeName("QtQuick.Gradient")); QCOMPARE(gradientNode.type(), QmlDesigner::TypeName("QtQuick.Gradient"));