QGIS API Documentation 3.41.0-Master (45a0abf3bec)
|
Contains utility functions for working with QVariants and QVariant types. More...
#include <qgsvariantutils.h>
Static Public Member Functions | |
static QVariant | createNullVariant (QMetaType::Type metaType) |
Helper method to properly create a null QVariant from a metaType Returns the created QVariant. | |
static bool | isNull (const QVariant &variant, bool silenceNullWarnings=false) |
Returns true if the specified variant should be considered a NULL value. | |
static bool | isNumericType (QMetaType::Type metaType) |
Returns true if the specified metaType is a numeric type. | |
static QVariant::Type | metaTypeToVariantType (QMetaType::Type metaType) |
Converts a QMetaType::Type to a QVariant::Type. | |
static QString | typeToDisplayString (QMetaType::Type type, QMetaType::Type subType=QMetaType::Type::UnknownType) |
Returns a user-friendly translated string representing a QVariant type. | |
static Q_DECL_DEPRECATED QString | typeToDisplayString (QVariant::Type type, QVariant::Type subType=QVariant::Type::Invalid) |
Returns a user-friendly translated string representing a QVariant type. | |
static QMetaType::Type | variantTypeToMetaType (QVariant::Type variantType) |
Converts a QVariant::Type to a QMetaType::Type. | |
Contains utility functions for working with QVariants and QVariant types.
Definition at line 31 of file qgsvariantutils.h.
|
static |
Helper method to properly create a null QVariant from a metaType Returns the created QVariant.
Definition at line 620 of file qgsvariantutils.cpp.
|
static |
Returns true
if the specified variant 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()
.
Definition at line 169 of file qgsvariantutils.cpp.
|
static |
Returns true
if the specified metaType is a numeric type.
Definition at line 473 of file qgsvariantutils.cpp.
|
static |
Converts a QMetaType::Type to a QVariant::Type.
Definition at line 500 of file qgsvariantutils.cpp.
|
static |
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.
Definition at line 37 of file qgsvariantutils.cpp.
|
static |
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.
Definition at line 164 of file qgsvariantutils.cpp.
|
static |
Converts a QVariant::Type to a QMetaType::Type.
Definition at line 494 of file qgsvariantutils.cpp.