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();
55 textValue = boolValue ? QObject::tr(
"true" ) : QObject::tr(
"false" );
59 if ( !value.canConvert<QString>() )
62 textValue = QObject::tr(
"(invalid)" );
66 textValue = value.toString();
67 if ( config.contains( QStringLiteral(
"CheckedState" ) ) && textValue == config[ QStringLiteral(
"CheckedState" ) ].toString() )
71 else if ( config.contains( QStringLiteral(
"UncheckedState" ) ) && textValue == config[ QStringLiteral(
"UncheckedState" ) ].toString() )
78 textValue = QStringLiteral(
"(%1)" ).arg( textValue );
89 switch ( displayMethod )
93 return QObject::tr(
"true" );
95 return QObject::tr(
"false" );