QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
Go to the documentation of this file.
34 return QStringLiteral(
"DateTime" );
49 const bool fieldIsoFormat = config.value( QStringLiteral(
"field_iso_format" ),
false ).toBool();
50 const QString fieldFormat = config.value( QStringLiteral(
"field_format" ),
defaultFormat(
field.
type() ) ).toString();
51 const QString displayFormat = config.value( QStringLiteral(
"display_format" ),
defaultFormat(
field.
type() ) ).toString();
54 if (
static_cast<QMetaType::Type
>( value.type() ) == QMetaType::QDate ||
static_cast<QMetaType::Type
>( value.type() ) == QMetaType::QDateTime )
56 date = value.toDateTime();
62 date = QDateTime::fromString( value.toString(), Qt::ISODate );
66 date = QDateTime::fromString( value.toString(), fieldFormat );
72 result = date.toString( displayFormat );
76 result = value.toString();
86 case QVariant::DateTime:
QgsFields fields() const FINAL
Returns the list of fields of this layer.
static QString nullRepresentation()
This string is used to represent the value NULL throughout QGIS.
Represents a vector layer which manages a vector based data sets.
QgsField at(int i) const
Gets field at particular index (must be in range 0..N-1)
Encapsulate a field in an attribute table or data source.