[Development] Behaviour change in QML in Qt 5.8 regarding null

Allan Sandfeld Jensen kde at carewolf.com
Wed Sep 28 01:22:33 CEST 2016


On Tuesday 27 September 2016, Thiago Macieira wrote:
> On terça-feira, 27 de setembro de 2016 18:22:34 PDT Simon Hausmann wrote:
> > I'm fairly sure we used QVariant(QMetaType::VoidStar);
> 
> Can you guarantee that the only time the QML engine generates null
> QVariants is for null JS Values? That is, no null QStrings, null
> QVariantLists, null QVariantMaps/Hahes, null doubles, etc.?
> 
> If that's the case, I'd recommend a doc update and unit tests. Chris can
> fix his code for isNull().
> 
> Note:
> 	QVariant::fromValue(nullptr).isNull() == false
> 	QVariant(QMetaType::Nullptr).isNull() == true

And QVariant(nullptr) doesn't compile.

We should probably fix the fromValue constructor.

`Allan



More information about the Development mailing list