diff options
author | A-Team <ateam@pad.test.qt.nokia.com> | 2010-10-13 22:00:15 (GMT) |
---|---|---|
committer | A-Team <ateam@pad.test.qt.nokia.com> | 2010-10-13 22:00:15 (GMT) |
commit | f103ad276181090da8c70bd29f4474ea7657e03f (patch) | |
tree | 699011ee56f49596079e786e93d8d507990f9614 /src/corelib | |
parent | b6a25ff0118adc4aa6ab1523496fd1a5e384ebd4 (diff) | |
parent | 28ef9731df2b3cd865af89cc474c5fa20c24e492 (diff) | |
download | Qt-f103ad276181090da8c70bd29f4474ea7657e03f.zip Qt-f103ad276181090da8c70bd29f4474ea7657e03f.tar.gz Qt-f103ad276181090da8c70bd29f4474ea7657e03f.tar.bz2 |
Merge branch '4.7-upstream' into 4.7-doc
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/kernel/qobject.cpp | 6 | ||||
-rw-r--r-- | src/corelib/kernel/qobject_p.h | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index 8330e47..579c225 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -127,6 +127,7 @@ extern "C" Q_CORE_EXPORT void qt_removeObject(QObject *) void (*QAbstractDeclarativeData::destroyed)(QAbstractDeclarativeData *, QObject *) = 0; void (*QAbstractDeclarativeData::parentChanged)(QAbstractDeclarativeData *, QObject *, QObject *) = 0; +void (*QAbstractDeclarativeData::objectNameChanged)(QAbstractDeclarativeData *, QObject *) = 0; QObjectData::~QObjectData() {} @@ -1094,7 +1095,12 @@ QString QObject::objectName() const void QObject::setObjectName(const QString &name) { Q_D(QObject); + bool objectNameChanged = d->declarativeData && d->objectName != name; + d->objectName = name; + + if (objectNameChanged) + d->declarativeData->objectNameChanged(d->declarativeData, this); } diff --git a/src/corelib/kernel/qobject_p.h b/src/corelib/kernel/qobject_p.h index 4800e6a..814769c 100644 --- a/src/corelib/kernel/qobject_p.h +++ b/src/corelib/kernel/qobject_p.h @@ -89,6 +89,7 @@ class Q_CORE_EXPORT QAbstractDeclarativeData public: static void (*destroyed)(QAbstractDeclarativeData *, QObject *); static void (*parentChanged)(QAbstractDeclarativeData *, QObject *, QObject *); + static void (*objectNameChanged)(QAbstractDeclarativeData *, QObject *); }; class Q_CORE_EXPORT QObjectPrivate : public QObjectData |