29 if (
field().type() == QVariant::Bool )
32 v = mGroupBox->isChecked();
34 v = mCheckBox->isChecked();
39 v = mGroupBox->isChecked() ?
config( QStringLiteral(
"CheckedState" ) ) :
config( QStringLiteral(
"UncheckedState" ) );
42 v = mCheckBox->isChecked() ?
config( QStringLiteral(
"CheckedState" ) ) :
config( QStringLiteral(
"UncheckedState" ) );
52 whileBlocking( mCheckBox )->setCheckState( Qt::PartiallyChecked );
58 return new QCheckBox( parent );
63 mCheckBox = qobject_cast<QCheckBox *>( editor );
64 mGroupBox = qobject_cast<QGroupBox *>( editor );
67 connect( mCheckBox, &QAbstractButton::toggled,
this, [ = ](
bool state )
75 connect( mGroupBox, &QGroupBox::toggled,
this, [ = ](
bool state )
86 return mCheckBox || mGroupBox;
89 void QgsCheckboxWidgetWrapper::updateValues(
const QVariant &value,
const QVariantList & )
93 if (
field().type() == QVariant::Bool )
95 state =
value.toBool();
99 state = (
value ==
config( QStringLiteral(
"CheckedState" ) ) );
103 mGroupBox->setChecked( state );
108 mCheckBox->setChecked( state );