summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/declarative/qml/qdeclarativecompiler.cpp2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/DeepComponent.qml7
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/deepProperty.qml4
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp12
4 files changed, 24 insertions, 1 deletions
diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp
index 85ae3ebc..6734e0b4 100644
--- a/src/declarative/qml/qdeclarativecompiler.cpp
+++ b/src/declarative/qml/qdeclarativecompiler.cpp
@@ -1147,7 +1147,7 @@ void QDeclarativeCompiler::genValueTypeProperty(QDeclarativeParser::Object *obj,
fetch.fetchValue.bindingSkipList = 0;
fetch.line = prop->location.start.line;
- if (obj->type == QMetaType::QVariant || output->types.at(obj->type).component) {
+ if (obj->type == -1 || output->types.at(obj->type).component) {
// We only have to do this if this is a composite type. If it is a builtin
// type it can't possibly already have bindings that need to be cleared.
foreach(Property *vprop, prop->value->valueProperties) {
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/DeepComponent.qml b/tests/auto/declarative/qdeclarativelanguage/data/DeepComponent.qml
new file mode 100644
index 00000000..55753def
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/DeepComponent.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.1
+Item {
+ property alias someObject: text
+ Text {
+ id: text
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/deepProperty.qml b/tests/auto/declarative/qdeclarativelanguage/data/deepProperty.qml
new file mode 100644
index 00000000..0787bded
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/deepProperty.qml
@@ -0,0 +1,4 @@
+import QtQuick 1.1
+DeepComponent {
+ someObject.font.family: "test"
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp
index 1574aa4a..8052f5fc 100644
--- a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp
+++ b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp
@@ -162,6 +162,8 @@ private slots:
void compatibilitySemicolon();
+ void deepProperty();
+
private:
QDeclarativeEngine engine;
void testType(const QString& qml, const QString& type, const QString& error);
@@ -2059,6 +2061,16 @@ void tst_qdeclarativelanguage::implicitImportsLast()
QCOMPARE(QString(object2->metaObject()->className()), QLatin1String("QDeclarativeRectangle"));
}
+void tst_qdeclarativelanguage::deepProperty()
+{
+ QDeclarativeComponent component(&engine, testFileUrl("deepProperty.qml"));
+ VERIFY_ERRORS(0);
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+ QFont font = qvariant_cast<QFont>(qvariant_cast<QObject*>(o->property("someObject"))->property("font"));
+ QCOMPARE(font.family(), QStringLiteral("test"));
+}
+
QTEST_MAIN(tst_qdeclarativelanguage)
#include "tst_qdeclarativelanguage.moc"