summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-11-12 00:45:53 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-11-12 00:45:53 (GMT)
commit517a48de8ec497f7e8367d64a28bf4c19e8a4744 (patch)
tree6d527cb9e6f4611ff72e74d416677a36f225d44d /tests/auto
parent49cc2d35d7da4a78d696503930720e88a6403722 (diff)
downloadQt-517a48de8ec497f7e8367d64a28bf4c19e8a4744.zip
Qt-517a48de8ec497f7e8367d64a28bf4c19e8a4744.tar.gz
Qt-517a48de8ec497f7e8367d64a28bf4c19e8a4744.tar.bz2
QML C++ class-in-namespace test
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/declarative/qmllanguage/testtypes.cpp1
-rw-r--r--tests/auto/declarative/qmllanguage/testtypes.h12
-rw-r--r--tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp21
3 files changed, 29 insertions, 5 deletions
diff --git a/tests/auto/declarative/qmllanguage/testtypes.cpp b/tests/auto/declarative/qmllanguage/testtypes.cpp
index c370c09..933431d 100644
--- a/tests/auto/declarative/qmllanguage/testtypes.cpp
+++ b/tests/auto/declarative/qmllanguage/testtypes.cpp
@@ -47,4 +47,5 @@ QML_DEFINE_TYPE(Test,1,0,MyContainer,MyContainer);
QML_DEFINE_TYPE(Test,1,0,MyPropertyValueSource,MyPropertyValueSource);
QML_DEFINE_TYPE(Test,1,0,MyDotPropertyObject,MyDotPropertyObject);
QML_DEFINE_TYPE(Test,1,0,MyNamespacedType,MyNamespace::MyNamespacedType);
+QML_DEFINE_TYPE(Test,1,0,MySecondNamespacedType,MyNamespace::MySecondNamespacedType);
QML_DEFINE_NOCREATE_TYPE(MyGroupedObject);
diff --git a/tests/auto/declarative/qmllanguage/testtypes.h b/tests/auto/declarative/qmllanguage/testtypes.h
index b251f87..3598d68 100644
--- a/tests/auto/declarative/qmllanguage/testtypes.h
+++ b/tests/auto/declarative/qmllanguage/testtypes.h
@@ -535,7 +535,19 @@ namespace MyNamespace {
{
Q_OBJECT
};
+
+ class MySecondNamespacedType : public QObject
+ {
+ Q_OBJECT
+ Q_PROPERTY(QmlList<MyNamespace::MyNamespacedType *> *list READ list);
+ public:
+ QmlList<MyNamespacedType *> *list() { return &m_list; }
+
+ private:
+ QmlConcreteList<MyNamespacedType *> m_list;
+ };
}
QML_DECLARE_TYPE(MyNamespace::MyNamespacedType);
+QML_DECLARE_TYPE(MyNamespace::MySecondNamespacedType);
#endif // TESTTYPES_H
diff --git a/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp b/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp
index a05ee06..d5c5c4d 100644
--- a/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp
+++ b/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp
@@ -693,11 +693,22 @@ void tst_qmllanguage::valueTypes()
void tst_qmllanguage::cppnamespace()
{
- QmlComponent component(&engine, TEST_FILE("cppnamespace.qml"));
- VERIFY_ERRORS(0);
- QObject *object = component.create();
- QVERIFY(object != 0);
- delete object;
+ {
+ QmlComponent component(&engine, TEST_FILE("cppnamespace.qml"));
+ VERIFY_ERRORS(0);
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+ delete object;
+ }
+
+ {
+ QmlComponent component(&engine, TEST_FILE("cppnamespace.2.qml"));
+ qWarning() << component.errors();
+ VERIFY_ERRORS(0);
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+ delete object;
+ }
}
void tst_qmllanguage::aliasProperties()