27 mDisplayAsTextComboBox->setCurrentIndex( 0 );
33 if ( vl->
fields().
at( fieldIdx ).
type() == QVariant::Bool )
35 leCheckedState->setEnabled(
false );
36 leUncheckedState->setEnabled(
false );
38 leCheckedState->setPlaceholderText( QStringLiteral(
"TRUE" ) );
39 leUncheckedState->setPlaceholderText( QStringLiteral(
"FALSE" ) );
47 cfg.insert( QStringLiteral(
"CheckedState" ), leCheckedState->text() );
48 cfg.insert( QStringLiteral(
"UncheckedState" ), leUncheckedState->text() );
49 cfg.insert( QStringLiteral(
"TextDisplayMethod" ), mDisplayAsTextComboBox->currentData().toInt() );
56 if (
layer()->fields().at(
field() ).type() != QVariant::Bool )
58 leCheckedState->setText(
config.value( QStringLiteral(
"CheckedState" ) ).toString() );
59 leUncheckedState->setText(
config.value( QStringLiteral(
"UncheckedState" ) ).toString() );
void setConfig(const QVariantMap &config) override
Update the configuration widget to represent the given configuration.
QVariantMap config() override
Create a configuration from the current GUI state.
QgsCheckBoxConfigDlg(QgsVectorLayer *vl, int fieldIdx, QWidget *parent=nullptr)
QgsField at(int i) const
Returns the field at particular index (must be in range 0..N-1).
Represents a vector layer which manages a vector based data sets.
QgsFields fields() const FINAL
Returns the list of fields of this layer.