diff options
Diffstat (limited to 'src/declarative/qml')
-rw-r--r-- | src/declarative/qml/qdeclarativeengine.cpp | 4 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativeprivate.h | 11 |
2 files changed, 13 insertions, 2 deletions
diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index c5afe92..85e8a9e 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -350,6 +350,10 @@ typedef QMap<QString, QString> StringStringMap; Q_GLOBAL_STATIC(StringStringMap, qmlEnginePluginsWithRegisteredTypes); // stores the uri +void QDeclarativePrivate::qdeclarativeelement_destructor(QObject *) +{ +} + void QDeclarativeDeclarativeData::destroyed(QDeclarativeData *d, QObject *o) { static_cast<QDeclarativeDeclarativeData *>(d)->destroyed(o); diff --git a/src/declarative/qml/qdeclarativeprivate.h b/src/declarative/qml/qdeclarativeprivate.h index bebe82c..6e240d8 100644 --- a/src/declarative/qml/qdeclarativeprivate.h +++ b/src/declarative/qml/qdeclarativeprivate.h @@ -69,11 +69,18 @@ public: class QDeclarativeCustomParser; namespace QDeclarativePrivate { + void Q_DECLARATIVE_EXPORT qdeclarativeelement_destructor(QObject *); template<typename T> - QObject *create() { return new T; } + class QDeclarativeElement : public T + { + public: + virtual ~QDeclarativeElement() { + QDeclarativePrivate::qdeclarativeelement_destructor(this); + } + }; template<typename T> - void createInto(void *memory) { new (memory) T; } + void createInto(void *memory) { new (memory) QDeclarativeElement<T>; } template<typename T> QObject *createParent(QObject *p) { return new T(p); } |