Mercurial > projects > qtd
diff generator/cppheadergenerator.cpp @ 248:7664de4a55e5
Fixed #23.
QtD_QObjectEntity is not created dynamically for shell classes any more.
Class initialization is now performed by static constructors.
When wrapping QObjects returned from functions, their run-time types are now taken into account.
QObjects are allocated on GC heap, a doubly-linked list is used to prevent them from been collected (arguably a better solution than allocating on C heap and adding GC ranges)
Minor changes (including unnecessary).
author | maxter |
---|---|
date | Thu, 20 Aug 2009 14:47:17 +0000 |
parents | 1349940724eb |
children | 37eed70de029 |
line wrap: on
line diff
--- a/generator/cppheadergenerator.cpp Fri Jul 31 11:05:22 2009 +0000 +++ b/generator/cppheadergenerator.cpp Thu Aug 20 14:47:17 2009 +0000 @@ -178,13 +178,15 @@ s << "class " << shellClassName(java_class) << " : public " << java_class->qualifiedCppName(); - if (java_class->hasVirtualFunctions()) - s << ", public Qtd_QObjectEntity"; + if (java_class->isQObject()) + s << ", public QtD_QObjectEntity"; + else if(java_class->hasVirtualFunctions()) + s << ", public QtD_Entity"; s << endl << "{" << endl; if (java_class->isQObject()) { s << "public:" << endl - << " Q_OBJECT_CHECK" << endl; + << " Q_OBJECT_CHECK" << endl // << " mutable const QMetaObject *m_meta_object;" << endl; /* if (java_class->hasVirtualSlots()) { @@ -193,9 +195,9 @@ */ // s << " const QMetaObject *metaObject() const;" << endl // << " void *qt_metacast(const char *);" << endl -// << " QT_TR_FUNCTIONS" << endl -// << " virtual int qt_metacall(QMetaObject::Call, int, void **);" << endl - s << "private:" << endl; +// << " QT_TR_FUNCTIONS" << end + << " virtual int qt_metacall(QMetaObject::Call, int, void **);" << endl + << "private:" << endl; }