| Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date | |
| All threads index page 4 | |
I come back the 03/01/2008 *** happy new year!! *** -- [ signature omitted ]
Frank Hemer wrote:
>On Thursday 27 December 2007 21:30:19 Frank Hemer wrote:
>> I also notice that:
>> QMetaType::type ("IntList")
>> and
>> qMetaTypeId ("IntList")
>
>oops ... missed a part:
>
>return different identifiers!
No such function qMetaTypeId("IntList"). If you meant
qMetaTypeId<IntList>(), then I think I understand why.
The reason is because you're calling it "IntList" instead of the canonical
name "QList<int>". Unfortunately, qMetaType<IntList>(),
qMetaType<QList<qint32> >() and qMetaType<QList<int> >() are all the same
function, whereas the strings aren't. And the meta type system cannot
know that.
So you must use the canonical name for the metatypes, or you may run into
unexpected problems like you're just seeing now. The fact that it worked
in a previous version of Qt is not the issue. Any library code could have
registered QList<int> under a different name, which can cause havoc.
I plan to address this metatype issue, but it's not very high in my
priority list. The big issue is types with more than one template
parameter -- since a comma breaks C macros, you have to use typedef for
those.
--
[ signature omitted ]
Attachment:
signature.asc
Description: This is a digitally signed message part.