summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp')
-rw-r--r--tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp b/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp
index ff78e6d..a991144 100644
--- a/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp
+++ b/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp
@@ -39,6 +39,7 @@ private slots:
void assignQmlComponent();
void assignBasicTypes();
void assignTypeExtremes();
+ void assignCompositeToType();
void customParserTypes();
void rootAsQmlComponent();
void inlineQmlComponents();
@@ -56,6 +57,7 @@ private slots:
void valueTypes();
void cppnamespace();
void aliasProperties();
+ void componentCompositeType();
void importsBuiltin_data();
void importsBuiltin();
@@ -323,6 +325,15 @@ void tst_qmllanguage::assignTypeExtremes()
QCOMPARE(object->intProperty(), -0x77359400);
}
+// Test that a composite type can assign to a property of its base type
+void tst_qmllanguage::assignCompositeToType()
+{
+ QmlComponent component(&engine, TEST_FILE("assignCompositeToType.qml"));
+ VERIFY_ERRORS(0);
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+}
+
// Tests that custom parser types can be instantiated
void tst_qmllanguage::customParserTypes()
{
@@ -647,6 +658,15 @@ void tst_qmllanguage::aliasProperties()
}
}
+// Test that the root element in a composite type can be a Component
+void tst_qmllanguage::componentCompositeType()
+{
+ QmlComponent component(&engine, TEST_FILE("componentCompositeType.qml"));
+ VERIFY_ERRORS(0);
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+}
+
class TestType : public QObject {
Q_OBJECT
public: