Compile problem with KUrl::operator QVariant()

Harri Porten porten at kde.org
Mon Mar 26 23:56:37 BST 2007


On Mon, 26 Mar 2007, Thiago Macieira wrote:

>> 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.

Precedence still does not change my personal preference to avoid fattening 
a class with all kinds of independant couplings that can be done outside.

> 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.

After all three places where changed the problem disappeared. Thank you.

Harri.




More information about the kde-core-devel mailing list