26 return QStringLiteral(
"CheckBox" );
47 bool isNull = value.isNull();
48 bool boolValue =
false;
51 const QVariant::Type fieldType = layer->
fields().
at( fieldIndex ).
type();
52 if ( fieldType == QVariant::Bool )
54 boolValue = value.toBool();
58 if ( !value.canConvert<QString>() )
61 textValue = QObject::tr(
"(invalid)" );
65 if ( config.contains( QStringLiteral(
"CheckedState" ) ) && value.toString() == config[ QStringLiteral(
"CheckedState" ) ].toString() )
69 else if ( config.contains( QStringLiteral(
"UncheckedState" ) ) && value.toString() == config[ QStringLiteral(
"UncheckedState" ) ].toString() )
76 textValue = QStringLiteral(
"(%1)" ).arg( value.toString() );
86 return QObject::tr(
"true" );
88 return QObject::tr(
"false" );
QgsField at(int i) const
Gets field at particular index (must be in range 0..N-1)
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.