[Development] Container refactor update

Peter Kümmel syntheticpp at gmx.net
Wed Jun 20 11:25:28 CEST 2012


On 20.06.2012 11:09, Olivier Goffart wrote:
>>
>> static const char qt_meta_stringdata_Foo<int>[] = {
>>       "Foo<int>\0\0t\0asignal(int)\0"
>> };
>
> That's because you are looking at Qt4.
> In Qt5 it is could be something more like  "Foo<T>\0asignal\0\0T\0t\0"
>
> And you can connect using the new pointer function syntax.
> And some little changes would be required to the other syntax for it to work,
> but it should be possible  (as now, the "signature" of the signal is only
> reconstructed at runtime)
>
> Foo<int>  foo;
> connect(&foo,&Foo<int>::asignal, this,&Bar::setInt);
> connect(&foo, SIGNAL(signal(int)), this, SLOT(setInt(int)));
>

OK, connection would work. But what I mean is, from the meta type
perspective Foo<int> and Foo<double> would have the same meta type.
Therefore the idea to use specialization, then you could define
qt_meta_stringdata_Foo for each type.

Peter



More information about the Development mailing list