Compile problem with KUrl::operator QVariant()

Thiago Macieira thiago at kde.org
Mon Mar 26 21:27:07 BST 2007


Harri Porten wrote:
>I can't compile kdelibs anymore (see attached error) since change
>
>   http://websvn.kde.org/?view=rev&revision=644457
>
>was applied that added a QVariant conversion operator to KUrl. Maybe my
>compiler is too old (gcc 3.3.5) but isn't there anyway to rewrite the
>code? After all, I find it to be a questionable design to add such
>operators. The conversion should be done outside of the class IMO.

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.

The only difference is that KUrl defines the operator inline, inside the 
class definition, in the .h. Apparently we can't do that: the operator 
should just declared in the .h and implemented separately in the .cpp. 
That should solve Harri's build problem.

-- 
  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/20070326/249f6ad9/attachment.sig>


More information about the kde-core-devel mailing list