[Qt-interest] QVariant::type() usage for custom QVariant types

Thiago Macieira thiago at kde.org
Thu Jul 28 15:38:10 CEST 2011


Answering the subject: QVariant::userType()

On Thursday, 28 de July de 2011 14:19:55 Eckhard Jokisch wrote:
> How can I use
> int i = v.type();
> and get a unique and reliable (in terms of usable in a switch/case)
> typenumber for my various classes?

You don't. You have to use userType().

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
      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/20110728/12817482/attachment.bin 


More information about the Qt-interest-old mailing list