[Development] Container refactor update

Peter Kümmel syntheticpp at gmx.net
Wed Jun 20 10:47:01 CEST 2012


On 19.06.2012 11:04, Olivier Goffart wrote:
>
> template<typename T>  QMetaObject A<T>::staticMetaObject = { ... };
>

Hi Oliver,

looking at this with some hacking on moc,


template<class T>
class Foo : public QObject
{
   Q_OBJECT

public:
   Foo() {}

signals:
   void asignal(T t);

};


it looks like generating templated code isn't complicated:

void Foo<T>::qt_static_metacall
...

but then we also get

static const char qt_meta_stringdata_Foo<T>[] = {
     "Foo<T>\0\0t\0asignal(T)\0"
};


Isn't this a big problem?
When Foo<int> is used, we would need the meta type information
with 'int' not with T:

static const char qt_meta_stringdata_Foo<int>[] = {
     "Foo<int>\0\0t\0asignal(int)\0"
};


Peter




More information about the Development mailing list