diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-10-11 02:07:24 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-10-11 02:07:24 (GMT) |
commit | 759da9b325f19670a3d79ede5f06fb3fa1f95495 (patch) | |
tree | 11403d8cfa3c8c0f1cf62c9f29108a34e8f30b7d /src/declarative/qml/qdeclarativefastproperties.cpp | |
parent | f69eeec7030a5df12803a9128819207e3fc5bead (diff) | |
download | Qt-759da9b325f19670a3d79ede5f06fb3fa1f95495.zip Qt-759da9b325f19670a3d79ede5f06fb3fa1f95495.tar.gz Qt-759da9b325f19670a3d79ede5f06fb3fa1f95495.tar.bz2 |
Allow objectName to be used in QML bindings
Task-number: QTBUG-13999
Diffstat (limited to 'src/declarative/qml/qdeclarativefastproperties.cpp')
-rw-r--r-- | src/declarative/qml/qdeclarativefastproperties.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/declarative/qml/qdeclarativefastproperties.cpp b/src/declarative/qml/qdeclarativefastproperties.cpp index eb69b6a..78e3afd 100644 --- a/src/declarative/qml/qdeclarativefastproperties.cpp +++ b/src/declarative/qml/qdeclarativefastproperties.cpp @@ -51,10 +51,19 @@ QT_BEGIN_NAMESPACE // primarily read from bindings is a candidate for inclusion as a fast // property. +static void QObject_objectName(QObject *object, void *output, QDeclarativeNotifierEndpoint *endpoint) +{ + if (endpoint) + endpoint->connect(QDeclarativeData::get(object, true)->objectNameNotifier()); + *((QString *)output) = object->objectName(); +} + QDeclarativeFastProperties::QDeclarativeFastProperties() { add(&QDeclarativeItem::staticMetaObject, QDeclarativeItem::staticMetaObject.indexOfProperty("parent"), QDeclarativeItemPrivate::parentProperty); + add(&QObject::staticMetaObject, QObject::staticMetaObject.indexOfProperty("objectName"), + QObject_objectName); } int QDeclarativeFastProperties::accessorIndexForProperty(const QMetaObject *metaObject, int propertyIndex) |