[Qt-interest] QVariant odd behaviour?

Linos info at linos.es
Sat Oct 8 23:25:04 CEST 2011


El 08/10/11 21:11, Thiago Macieira escribió:
> On Saturday, 8 de October de 2011 19:45:44 Linos wrote:
>> Hi,
>> 	should not be a return a null QVariant(QVariant::Int) .toString() method
>> QString("") instead of QString("0"), it seems a bit odd for me, example
> 
> When you convert any int to QString, QVariant takes the stored value, 
> regardless of whether the "null" flag was active. That value was 0.
> 
> 

I supposed this was intended but, regardless of the implementation detail,
should not be better and empty string from a null QVariant that the same string
we would get from a real QVariant(0)?

Regards,
Miguel Angel.




More information about the Qt-interest-old mailing list