Custom-type QVariant comparison in KConfigDialogManager

Thiago Macieira thiago at kde.org
Sun Jun 17 11:41:45 BST 2007


Andreas Pakulat wrote:
>You mean we can have a QVariant::operator==() which also works for
>KUrl-QVariants? How?

No, you can't have that.

You need to detect the meta type ID of the types you want to check and 
then test manually.

if (item->property.userType() == qMetaTypeId<KUrl>() &&
    p.userType() == qMetaTypeId<KUrl>() &&
    qvariant_cast<KUrl>(item->property) == qvariant_cast<KUrl>(p))


-- 
  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: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070617/f0a74299/attachment.sig>


More information about the kde-core-devel mailing list