summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2010-02-17 03:39:45 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2010-02-17 03:39:45 (GMT)
commit9f12ede32d9eaadde7b1f72cf2191f39d5780d57 (patch)
tree96bbdc9d95c9cd9e087ab2f7c0d19e18e28a1e4a /tests
parentb4754aa9a3761c1bcd8519280d98e34371f4ff10 (diff)
downloadQt-9f12ede32d9eaadde7b1f72cf2191f39d5780d57.zip
Qt-9f12ede32d9eaadde7b1f72cf2191f39d5780d57.tar.gz
Qt-9f12ede32d9eaadde7b1f72cf2191f39d5780d57.tar.bz2
Revert "Replace QList<>* support with QmlListProperty"
This was accidentally pushed early. This reverts commit 8454c53b304a4aba7c058b315041b3a38ad4fff5.
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/declarative/qmlecmascript/testtypes.h8
-rw-r--r--tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp2
-rw-r--r--tests/auto/declarative/qmllanguage/testtypes.h11
-rw-r--r--tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp34
-rw-r--r--tests/auto/declarative/qmllistaccessor/tst_qmllistaccessor.cpp10
5 files changed, 32 insertions, 33 deletions
diff --git a/tests/auto/declarative/qmlecmascript/testtypes.h b/tests/auto/declarative/qmlecmascript/testtypes.h
index b307d9c..09c850d 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(QmlListProperty<QObject> objectListProperty READ objectListProperty CONSTANT)
+ Q_PROPERTY(QList<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; }
- QmlListProperty<QObject> objectListProperty() { return QmlListProperty<QObject>(this, m_objectQList); }
+ QList<QObject *> *objectListProperty() { return &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(QmlListProperty<MyQmlObject> children READ children CONSTANT)
+ Q_PROPERTY(QList<MyQmlObject*>* children READ children CONSTANT)
public:
MyQmlContainer() {}
- QmlListProperty<MyQmlObject> children() { return QmlListProperty<MyQmlObject>(this, m_children); }
+ QList<MyQmlObject*> *children() { return &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 f8a4f5a..4edca69 100644
--- a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp
+++ b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp
@@ -1612,7 +1612,7 @@ void tst_qmlecmascript::listToVariant()
QObject *object = component.create(&context);
QVERIFY(object != 0);
- QVERIFY(qvariant_cast<QmlListProperty<MyQmlObject> >(object->property("test")) == container.children());
+ QCOMPARE(object->property("test"), QVariant::fromValue(container.children()));
delete object;
}
diff --git a/tests/auto/declarative/qmllanguage/testtypes.h b/tests/auto/declarative/qmllanguage/testtypes.h
index 6cd4cb5..d6ca898 100644
--- a/tests/auto/declarative/qmllanguage/testtypes.h
+++ b/tests/auto/declarative/qmllanguage/testtypes.h
@@ -447,20 +447,19 @@ QML_DECLARE_TYPE(MyTypeObject);
class MyContainer : public QObject
{
Q_OBJECT
- Q_PROPERTY(QmlListProperty<QObject> children READ children)
- Q_PROPERTY(QmlListProperty<MyInterface> qlistInterfaces READ qlistInterfaces)
+ Q_PROPERTY(QList<QObject*>* children READ children)
+ Q_PROPERTY(QList<MyInterface*>* qlistInterfaces READ qlistInterfaces)
Q_PROPERTY(QmlList<MyInterface*>* qmllistInterfaces READ qmllistInterfaces)
Q_CLASSINFO("DefaultProperty", "children");
public:
MyContainer() {}
- QmlListProperty<QObject> children() { return QmlListProperty<QObject>(this, m_children); }
- QList<QObject *> *getChildren() { return &m_children; }
- QmlListProperty<MyInterface> qlistInterfaces() { return QmlListProperty<MyInterface>(this, m_interfaces); }
- QList<MyInterface *> *getQListInterfaces() { return &m_interfaces; }
+ QList<QObject*> *children() { return &m_children; }
+ QList<MyInterface *> *qlistInterfaces() { return &m_interfaces; }
QmlList<MyInterface *> *qmllistInterfaces() { return &m_qmlinterfaces; }
const QmlConcreteList<MyInterface *> &qmllistAccessor() const { return m_qmlinterfaces; }
+private:
QList<QObject*> m_children;
QList<MyInterface *> m_interfaces;
QmlConcreteList<MyInterface *> m_qmlinterfaces;
diff --git a/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp b/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp
index 1e68f5a..3029501 100644
--- a/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp
+++ b/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp
@@ -354,7 +354,7 @@ void tst_qmllanguage::simpleContainer()
VERIFY_ERRORS(0);
MyContainer *container= qobject_cast<MyContainer*>(component.create());
QVERIFY(container != 0);
- QCOMPARE(container->getChildren()->count(),2);
+ QCOMPARE(container->children()->count(),2);
}
void tst_qmllanguage::interfaceProperty()
@@ -384,9 +384,9 @@ void tst_qmllanguage::interfaceQList()
VERIFY_ERRORS(0);
MyContainer *container= qobject_cast<MyContainer*>(component.create());
QVERIFY(container != 0);
- QVERIFY(container->getQListInterfaces()->count() == 2);
+ QVERIFY(container->qlistInterfaces()->count() == 2);
for(int ii = 0; ii < 2; ++ii)
- QVERIFY(container->getQListInterfaces()->at(ii)->id == 913);
+ QVERIFY(container->qlistInterfaces()->at(ii)->id == 913);
}
void tst_qmllanguage::assignObjectToSignal()
@@ -425,8 +425,8 @@ void tst_qmllanguage::assignQmlComponent()
VERIFY_ERRORS(0);
MyContainer *object = qobject_cast<MyContainer *>(component.create());
QVERIFY(object != 0);
- QVERIFY(object->getChildren()->count() == 1);
- QObject *child = object->getChildren()->at(0);
+ QVERIFY(object->children()->count() == 1);
+ QObject *child = object->children()->at(0);
QCOMPARE(child->property("x"), QVariant(10));
QCOMPARE(child->property("y"), QVariant(11));
}
@@ -504,7 +504,7 @@ void tst_qmllanguage::rootAsQmlComponent()
MyContainer *object = qobject_cast<MyContainer *>(component.create());
QVERIFY(object != 0);
QCOMPARE(object->property("x"), QVariant(11));
- QCOMPARE(object->getChildren()->count(), 2);
+ QCOMPARE(object->children()->count(), 2);
}
// Tests that components can be specified inline
@@ -514,8 +514,8 @@ void tst_qmllanguage::inlineQmlComponents()
VERIFY_ERRORS(0);
MyContainer *object = qobject_cast<MyContainer *>(component.create());
QVERIFY(object != 0);
- QCOMPARE(object->getChildren()->count(), 1);
- QmlComponent *comp = qobject_cast<QmlComponent *>(object->getChildren()->at(0));
+ QCOMPARE(object->children()->count(), 1);
+ QmlComponent *comp = qobject_cast<QmlComponent *>(object->children()->at(0));
QVERIFY(comp != 0);
MyQmlObject *compObject = qobject_cast<MyQmlObject *>(comp->create());
QVERIFY(compObject != 0);
@@ -529,9 +529,9 @@ void tst_qmllanguage::idProperty()
VERIFY_ERRORS(0);
MyContainer *object = qobject_cast<MyContainer *>(component.create());
QVERIFY(object != 0);
- QCOMPARE(object->getChildren()->count(), 1);
+ QCOMPARE(object->children()->count(), 1);
MyTypeObject *child =
- qobject_cast<MyTypeObject *>(object->getChildren()->at(0));
+ qobject_cast<MyTypeObject *>(object->children()->at(0));
QVERIFY(child != 0);
QCOMPARE(child->id(), QString("myObjectId"));
QCOMPARE(object->property("object"), QVariant::fromValue((QObject *)child));
@@ -1034,13 +1034,13 @@ void tst_qmllanguage::defaultPropertyListOrder()
MyContainer *container = qobject_cast<MyContainer *>(component.create());
QVERIFY(container != 0);
- QCOMPARE(container->getChildren()->count(), 6);
- QCOMPARE(container->getChildren()->at(0)->property("index"), QVariant(0));
- QCOMPARE(container->getChildren()->at(1)->property("index"), QVariant(1));
- QCOMPARE(container->getChildren()->at(2)->property("index"), QVariant(2));
- QCOMPARE(container->getChildren()->at(3)->property("index"), QVariant(3));
- QCOMPARE(container->getChildren()->at(4)->property("index"), QVariant(4));
- QCOMPARE(container->getChildren()->at(5)->property("index"), QVariant(5));
+ QCOMPARE(container->children()->count(), 6);
+ QCOMPARE(container->children()->at(0)->property("index"), QVariant(0));
+ QCOMPARE(container->children()->at(1)->property("index"), QVariant(1));
+ QCOMPARE(container->children()->at(2)->property("index"), QVariant(2));
+ QCOMPARE(container->children()->at(3)->property("index"), QVariant(3));
+ QCOMPARE(container->children()->at(4)->property("index"), QVariant(4));
+ QCOMPARE(container->children()->at(5)->property("index"), QVariant(5));
}
void tst_qmllanguage::declaredPropertyValues()
diff --git a/tests/auto/declarative/qmllistaccessor/tst_qmllistaccessor.cpp b/tests/auto/declarative/qmllistaccessor/tst_qmllistaccessor.cpp
index 9bf47b6..ddf9a07 100644
--- a/tests/auto/declarative/qmllistaccessor/tst_qmllistaccessor.cpp
+++ b/tests/auto/declarative/qmllistaccessor/tst_qmllistaccessor.cpp
@@ -52,7 +52,7 @@ public:
private slots:
void invalid();
void qmllist();
- void listproperty();
+ void qlist();
void qstringlist();
void qvariantlist();
void qobject();
@@ -149,7 +149,7 @@ void tst_QmlListAccessor::qmllist()
QCOMPARE(list.count(), 0);
}
-void tst_QmlListAccessor::listproperty()
+void tst_QmlListAccessor::qlist()
{
QList<QObject*> list;
QObject *obj = new QObject(this);
@@ -161,11 +161,11 @@ void tst_QmlListAccessor::listproperty()
QCOMPARE(list.at(0), obj);
QmlListAccessor accessor;
- accessor.setList(qVariantFromValue(QmlListProperty<QObject>(this, list)));
- QVERIFY(qvariant_cast<QmlListProperty<QObject> >(accessor.list()) == QmlListProperty<QObject>(this, list));
+ accessor.setList(qVariantFromValue((QList<QObject*>*)&list));
+ QCOMPARE(accessor.list(), qVariantFromValue((QList<QObject*>*)&list));
// type
- QCOMPARE(accessor.type(), QmlListAccessor::ListProperty);
+ QCOMPARE(accessor.type(), QmlListAccessor::QListPtr);
// isValid
QVERIFY(accessor.isValid());