summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qmlecmascript
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2010-02-09 05:09:42 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2010-02-09 05:42:41 (GMT)
commitd914555badcd4761864657e1e335e657b791453f (patch)
treee2038d1adea4efada31c4732cd36a71fbec2fbb7 /tests/auto/declarative/qmlecmascript
parent2f653cc06b97b443b9832d0121dbf92b35dd32c2 (diff)
downloadQt-d914555badcd4761864657e1e335e657b791453f.zip
Qt-d914555badcd4761864657e1e335e657b791453f.tar.gz
Qt-d914555badcd4761864657e1e335e657b791453f.tar.bz2
Replace QList<>* support with QmlListProperty
Diffstat (limited to 'tests/auto/declarative/qmlecmascript')
-rw-r--r--tests/auto/declarative/qmlecmascript/testtypes.h8
-rw-r--r--tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp2
2 files changed, 5 insertions, 5 deletions
diff --git a/tests/auto/declarative/qmlecmascript/testtypes.h b/tests/auto/declarative/qmlecmascript/testtypes.h
index 09c850d..b307d9c 100644
--- a/tests/auto/declarative/qmlecmascript/testtypes.h
+++ b/tests/auto/declarative/qmlecmascript/testtypes.h
@@ -78,7 +78,7 @@ class MyQmlObject : public QObject
Q_PROPERTY(QString stringProperty READ stringProperty WRITE setStringProperty NOTIFY stringChanged)
Q_PROPERTY(QObject *objectProperty READ objectProperty WRITE setObjectProperty NOTIFY objectChanged)
Q_PROPERTY(QmlList<QObject *> *objectQmlListProperty READ objectQmlListProperty CONSTANT)
- Q_PROPERTY(QList<QObject *> *objectListProperty READ objectListProperty CONSTANT)
+ Q_PROPERTY(QmlListProperty<QObject> objectListProperty READ objectListProperty CONSTANT)
Q_PROPERTY(int resettableProperty READ resettableProperty WRITE setResettableProperty RESET resetProperty)
public:
@@ -108,7 +108,7 @@ public:
}
QmlList<QObject *> *objectQmlListProperty() { return &m_objectQmlList; }
- QList<QObject *> *objectListProperty() { return &m_objectQList; }
+ QmlListProperty<QObject> objectListProperty() { return QmlListProperty<QObject>(this, m_objectQList); }
bool methodCalled() const { return m_methodCalled; }
bool methodIntCalled() const { return m_methodIntCalled; }
@@ -162,11 +162,11 @@ QML_DECLARE_TYPE(MyQmlObject);
class MyQmlContainer : public QObject
{
Q_OBJECT
- Q_PROPERTY(QList<MyQmlObject*>* children READ children CONSTANT)
+ Q_PROPERTY(QmlListProperty<MyQmlObject> children READ children CONSTANT)
public:
MyQmlContainer() {}
- QList<MyQmlObject*> *children() { return &m_children; }
+ QmlListProperty<MyQmlObject> children() { return QmlListProperty<MyQmlObject>(this, m_children); }
private:
QList<MyQmlObject*> m_children;
diff --git a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp
index 1ba9a52..cc5d7f2 100644
--- a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp
+++ b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp
@@ -1608,7 +1608,7 @@ void tst_qmlecmascript::listToVariant()
QObject *object = component.create(&context);
QVERIFY(object != 0);
- QCOMPARE(object->property("test"), QVariant::fromValue(container.children()));
+ QVERIFY(qvariant_cast<QmlListProperty<MyQmlObject> >(object->property("test")) == container.children());
delete object;
}