2 Commits

Author SHA1 Message Date
Nyall Dawson
8171b76ddd Introduce QgsVariantUtils::isNull( QVariant )
This method restores the Qt 5 logic for testing for null variants,
where for core Qt types the isNull check is forwarded to the actual
data type.

E.g. on Qt 5:  QVariant( QDateTime()).isNull() is true, but
on Qt 6 it's false

This breaks a LOT of assumptions made throughout QGIS. The new
helper method avoids this breakage by ensuring we follow the Qt 5
logic also on Qt 6 builds, and also gives us the option to extend
this logic for user types (e.g QVariant( QgsGeometry() ).isNull() could
return true). (That's not included here)
2022-08-20 15:35:09 +10:00
Nyall Dawson
a20f7789d9 Partial work on centralizing all QVariant::Type to display string
logic in a new QgsVariantUtils class

(I've likely missed a few places here, but it's a start!)
2022-01-31 17:24:53 +10:00