Class: QgsVariantUtils¶
- class qgis.core.QgsVariantUtils¶
Bases:
sip.wrapper
Contains utility functions for working with QVariants and QVariant types.
New in version 3.24:
Methods
Returns
True
if the specifiedvariant
should be considered a NULL value.Returns a user-friendly translated string representing a QVariant
type
.- isNull(variant: Any) bool ¶
Returns
True
if the specifiedvariant
should be considered a NULL value.This method is more rigorous vs QVariant.isNull(), which will return
False
on newer Qt versions for tests like QVariant( QDateTime() ).isNull().New in version 3.28.
- Parameters:
variant (Any) –
- Return type:
bool
- typeToDisplayString(type: QVariant.Type, subType: QVariant.Type = QVariant.Type.Invalid) str ¶
Returns a user-friendly translated string representing a QVariant
type
.The optional
subType
can be used to specify the type of variant list or map values.- Parameters:
type (QVariant.Type) –
subType (QVariant.Type = QVariant.Type.Invalid) –
- Return type:
str