aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlproperty.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@theqtcompany.com>2014-10-22 16:47:01 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2014-10-23 10:29:06 +0200
commit40a6845bcce22aca96e1dee26360bdff3e9520fb (patch)
tree4418dd6bffa51e8d2396b764912286e5013e2385 /src/qml/qml/qqmlproperty.cpp
parente2764c722571025835e41632637d1421ba44fb02 (diff)
Fix assignment to QObject pointer properties
This commit ammends 59ed8c355b99df0b949003a438ab850274261aa0 to always query the Qt meta-type registry to retrieve the QMetaObject for a QObject pointer type. Change-Id: I70d876a5acfa23967fd1a57c96fcd5ac853eaf49 Task-number: QTBUG-39614 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: Ulf Hermann <ulf.hermann@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlproperty.cpp')
-rw-r--r--src/qml/qml/qqmlproperty.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/qml/qml/qqmlproperty.cpp b/src/qml/qml/qqmlproperty.cpp
index 09b735ae9e..2a888b7a1e 100644
--- a/src/qml/qml/qqmlproperty.cpp
+++ b/src/qml/qml/qqmlproperty.cpp
@@ -1611,15 +1611,14 @@ bool QQmlPropertyPrivate::writeBinding(QObject *object,
QQmlMetaObject QQmlPropertyPrivate::rawMetaObjectForType(QQmlEnginePrivate *engine, int userType)
{
- if (engine) {
+ QMetaType metaType(userType);
+ if ((metaType.flags() & QMetaType::PointerToQObject) && metaType.metaObject())
+ return metaType.metaObject();
+ if (engine)
return engine->rawMetaObjectForType(userType);
- }
QQmlType *type = QQmlMetaType::qmlType(userType);
if (type)
return QQmlMetaObject(type->baseMetaObject());
- QMetaType metaType(userType);
- if ((metaType.flags() & QMetaType::PointerToQObject) && metaType.metaObject())
- return metaType.metaObject();
return QQmlMetaObject((QObject*)0);
}