Compile problem with KUrl::operator QVariant()

Thiago Macieira thiago at kde.org
Tue Mar 27 05:53:16 BST 2007


Harri Porten wrote:
>> Qt uses that construct in its GUI types that are part of QVariant. I
>> see no problem doing that in our own code as well.
>
>Precedence still does not change my personal preference to avoid
> fattening a class with all kinds of independant couplings that can be
> done outside.

This is to avoid the following:

	QString url;
	QVariant v = url;
as well as:
	QUrl url;
	QVariant v = url;
but:
	KUrl url;
	QVariant v = qVariantFromValue(url);

That is, you have to know that it's a KUrl and, therefore, it requires a 
modified syntax to be placed inside a QVariant.

-- 
  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: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070327/02c49a2b/attachment.sig>


More information about the kde-core-devel mailing list