[Interest] Why no T& QVariant::value()?

Allan Sandfeld Jensen kde at carewolf.com
Mon Jun 4 22:46:06 CEST 2018


On Montag, 4. Juni 2018 09:00:28 CEST Giuseppe D'Angelo wrote:
> Il 23/05/2018 16:16, Jason H ha scritto:
> > Really wishing this function existed. Can someone explain why it doesnt'
> > exist?
> Because QVariant (as well as most Qt APIs) has wide contracts; combined
> with the policy of not using exceptions, that makes such a function
> impossible to implement.
> 
Actually it probably could be, but it would be ugly, we already do something 
similar for QJsonValues, though on a more limited scope. And depending on what 
you want from it, it might need to be type strong and templated for a specific 
type T.

'Allan





More information about the Interest mailing list