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 ) { emit
valueChanged( state ); } );
69 connect( mGroupBox, &QGroupBox::toggled,
this, [ = ](
bool state ) { emit
valueChanged( state ); } );
74 return mCheckBox || mGroupBox;
81 if (
field().type() == QVariant::Bool )
83 state = value.toBool();
87 state = ( value ==
config( QStringLiteral(
"CheckedState" ) ) );
91 mGroupBox->setChecked( state );
96 mCheckBox->setChecked( state );
QgsSignalBlocker< Object > whileBlocking(Object *object)
Temporarily blocks signals from a QObject while calling a single method from the object.
Represents a vector layer which manages a vector based data sets.