From: Aaron Kennedy Date: Tue, 5 Jul 2011 03:01:50 +0000 (+1000) Subject: Correct handling of QObject* and QWidget* properties X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=06ce394b06214569e0a863dcc3ad8538c8a6aa47;p=konrad%2Fqtdeclarative.git Correct handling of QObject* and QWidget* properties Change-Id: I28eb68bc0236d5f7a7f9cc178462c3ad6055924e Reviewed-on: http://codereview.qt.nokia.com/1128 Reviewed-by: Qt Sanity Bot Reviewed-by: Aaron Kennedy --- diff --git a/src/declarative/qml/qdeclarativepropertycache.cpp b/src/declarative/qml/qdeclarativepropertycache.cpp index 24dc15a..8dba8e4 100644 --- a/src/declarative/qml/qdeclarativepropertycache.cpp +++ b/src/declarative/qml/qdeclarativepropertycache.cpp @@ -80,7 +80,7 @@ static QDeclarativePropertyCache::Data::Flags flagsForPropertyType(int propType, { QDeclarativePropertyCache::Data::Flags flags; - if (propType < QMetaType::User) { + if (propType < QMetaType::User && propType != QMetaType::QObjectStar && propType != QMetaType::QWidgetStar) { } else if (propType == qMetaTypeId()) { flags |= QDeclarativePropertyCache::Data::IsQmlBinding; } else if (propType == qMetaTypeId()) { @@ -118,7 +118,10 @@ void QDeclarativePropertyCache::Data::lazyLoad(const QMetaProperty &p, QDeclarat flags = fastFlagsForProperty(p); int type = p.type(); - if (type == QVariant::UserType || type == -1) { + if (type == QMetaType::QObjectStar || type == QMetaType::QWidgetStar) { + propType = type; + flags |= QDeclarativePropertyCache::Data::IsQObjectDerived; + } else if (type == QVariant::UserType || type == -1) { propTypeName = p.typeName(); flags |= QDeclarativePropertyCache::Data::NotFullyResolved; } else {