summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qobject.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2009-07-31 16:46:11 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2009-08-04 14:29:34 (GMT)
commitd6e7238903d381bf2c2c9f89c17085e714384e87 (patch)
treeb47b9969b15cdd9c4faf92011692864d8be655f9 /src/corelib/kernel/qobject.cpp
parent9081e1e65681aab1c1d8a913b1a493fe1d37e837 (diff)
downloadQt-d6e7238903d381bf2c2c9f89c17085e714384e87.zip
Qt-d6e7238903d381bf2c2c9f89c17085e714384e87.tar.gz
Qt-d6e7238903d381bf2c2c9f89c17085e714384e87.tar.bz2
Reorganise QObjectPrivate so that it's easier to tell what's in it.
Also rename QDeclarativeData to QObjectDeletionNotification, since it has no relation to declarative UI. It's just notification of the object's deletion. Make the destructor non-inline and place it in qobject.cpp, so that the virtual table is emitted there and exported from QtCore. Also move the QObjectData destructor to qobject.cpp. This means you cannot create any class deriving directly from QObjectData outside QtCore, which is the intention anyways (it's a private class and only QObjectPrivate derives from it). Reviewed-by: Bradley T. Hughes
Diffstat (limited to 'src/corelib/kernel/qobject.cpp')
-rw-r--r--src/corelib/kernel/qobject.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index c989d15..1938012 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -122,8 +122,11 @@ extern "C" Q_CORE_EXPORT void qt_removeObject(QObject *)
}
}
+QObjectData::~QObjectData() {}
+QObjectDeletionNotification::~QObjectDeletionNotification() {}
+
QObjectPrivate::QObjectPrivate(int version)
- : threadData(0), currentSender(0), declarativeData(0), connectionLists(0), senders(0)
+ : threadData(0), connectionLists(0), senders(0), currentSender(0), deletionNotification(0), objectGuards(0)
{
if (version != QObjectPrivateVersion)
qFatal("Cannot mix incompatible Qt libraries");
@@ -144,7 +147,6 @@ QObjectPrivate::QObjectPrivate(int version)
inEventHandler = false;
inThreadChangeEvent = false;
deleteWatch = 0;
- objectGuards = 0;
metaObject = 0;
hasGuards = false;
}
@@ -767,6 +769,8 @@ QObject::~QObject()
}
emit destroyed(this);
+ if (d->deletionNotification)
+ d->deletionNotification->destroyed(this);
{
QMutexLocker locker(signalSlotLock(this));
@@ -844,14 +848,6 @@ QObject::~QObject()
d->eventFilters.clear();
- // As declarativeData is in a union with currentChildBeingDeleted, this must
- // be done (and declarativeData set back to 0) before deleting children.
- if(d->declarativeData) {
- QDeclarativeData *dd = d->declarativeData;
- d->declarativeData = 0;
- dd->destroyed(this);
- }
-
if (!d->children.isEmpty())
d->deleteChildren();