[Qt-interest] QMetaType::type succeeds or fails seemingly
Thiago Macieira
thiago at kde.org
Wed Sep 28 10:31:10 CEST 2011
On Wednesday, 28 de September de 2011 10:15:34 Stefan Majewsky wrote:
> On Mon, Sep 26, 2011 at 4:50 PM, Schimkowitsch Robert
>
> <Robert.Schimkowitsch at andritz.com> wrote:
> > Which brings up the question: When does Q_DECLARE_METATYPE run, and how
> > do I make it run?
>
> Looking at the definition of Q_DECLARE_METATYPE, in
> include/QtCore/qmetatype.h, you should be able to "make it run" by
>
> (void) QMetaType<MyType>::qt_metatype_id();
>
> before the QMetaType::type() call. I don't know about the ABI
> stability policy for this macro, but I think this should be
> binary-compatible until at least Qt 5.
You can use the documented way:
qRegisterMetaType<MyType>();
--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
Software Architect - Intel Open Source Technology Center
PGP/GPG: 0x6EF45358; fingerprint:
E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110928/fc340215/attachment.bin
More information about the Qt-interest-old
mailing list