summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qdeclarativeprivate.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/qml/qdeclarativeprivate.h')
-rw-r--r--src/declarative/qml/qdeclarativeprivate.h11
1 files changed, 9 insertions, 2 deletions
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); }