summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorA-Team <ateam@pad.test.qt.nokia.com>2010-10-13 22:00:15 (GMT)
committerA-Team <ateam@pad.test.qt.nokia.com>2010-10-13 22:00:15 (GMT)
commitf103ad276181090da8c70bd29f4474ea7657e03f (patch)
tree699011ee56f49596079e786e93d8d507990f9614 /src/corelib
parentb6a25ff0118adc4aa6ab1523496fd1a5e384ebd4 (diff)
parent28ef9731df2b3cd865af89cc474c5fa20c24e492 (diff)
downloadQt-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.cpp6
-rw-r--r--src/corelib/kernel/qobject_p.h1
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