diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-02-22 04:56:49 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-02-22 05:53:27 (GMT) |
commit | 33eb76f050b45718d87926a8ff7afc89d6201c16 (patch) | |
tree | 935ddc2337b3891aab1ad7edcb06a62aabf14668 /tests/auto/declarative/qmlgraphicspathview | |
parent | 5f63321e3fe2b436d469d2722dc464ea4c7830c4 (diff) | |
download | Qt-33eb76f050b45718d87926a8ff7afc89d6201c16.zip Qt-33eb76f050b45718d87926a8ff7afc89d6201c16.tar.gz Qt-33eb76f050b45718d87926a8ff7afc89d6201c16.tar.bz2 |
Replace QmlList* and QList* support with a single QmlListProperty type
As a value type QmlListProperty doesn't consume any memory in the object.
It also has a companion QmlListReference class that is part of the public
API for C++ developers to interact with that also manages memory issues
that existed with previous solutions (if the containing QObject was
destroyed it left a dangling pointer).
Diffstat (limited to 'tests/auto/declarative/qmlgraphicspathview')
-rw-r--r-- | tests/auto/declarative/qmlgraphicspathview/tst_qmlgraphicspathview.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/auto/declarative/qmlgraphicspathview/tst_qmlgraphicspathview.cpp b/tests/auto/declarative/qmlgraphicspathview/tst_qmlgraphicspathview.cpp index 072f740..b986a64 100644 --- a/tests/auto/declarative/qmlgraphicspathview/tst_qmlgraphicspathview.cpp +++ b/tests/auto/declarative/qmlgraphicspathview/tst_qmlgraphicspathview.cpp @@ -268,31 +268,31 @@ void tst_QmlGraphicsPathView::path() QCOMPARE(obj->startY(), 100.); QVERIFY(obj->path() != QPainterPath()); - QList<QmlGraphicsPathElement*> *list = obj->pathElements(); - QCOMPARE(list->count(), 5); + QmlListReference list(obj, "pathElements"); + QCOMPARE(list.count(), 5); - QmlGraphicsPathAttribute* attr = qobject_cast<QmlGraphicsPathAttribute*>(list->at(0)); + QmlGraphicsPathAttribute* attr = qobject_cast<QmlGraphicsPathAttribute*>(list.at(0)); QVERIFY(attr != 0); QCOMPARE(attr->name(), QString("scale")); QCOMPARE(attr->value(), 1.0); - QmlGraphicsPathQuad* quad = qobject_cast<QmlGraphicsPathQuad*>(list->at(1)); + QmlGraphicsPathQuad* quad = qobject_cast<QmlGraphicsPathQuad*>(list.at(1)); QVERIFY(quad != 0); QCOMPARE(quad->x(), 120.); QCOMPARE(quad->y(), 25.); QCOMPARE(quad->controlX(), 260.); QCOMPARE(quad->controlY(), 75.); - QmlGraphicsPathPercent* perc = qobject_cast<QmlGraphicsPathPercent*>(list->at(2)); + QmlGraphicsPathPercent* perc = qobject_cast<QmlGraphicsPathPercent*>(list.at(2)); QVERIFY(perc != 0); QCOMPARE(perc->value(), 0.3); - QmlGraphicsPathLine* line = qobject_cast<QmlGraphicsPathLine*>(list->at(3)); + QmlGraphicsPathLine* line = qobject_cast<QmlGraphicsPathLine*>(list.at(3)); QVERIFY(line != 0); QCOMPARE(line->x(), 120.); QCOMPARE(line->y(), 100.); - QmlGraphicsPathCubic* cubic = qobject_cast<QmlGraphicsPathCubic*>(list->at(4)); + QmlGraphicsPathCubic* cubic = qobject_cast<QmlGraphicsPathCubic*>(list.at(4)); QVERIFY(cubic != 0); QCOMPARE(cubic->x(), 180.); QCOMPARE(cubic->y(), 0.); |