25#include "moc_qgscheckboxsearchwidgetwrapper.cpp"
51 if ( fieldType == QMetaType::Type::Bool )
53 v = mCheckBox->isChecked();
57 v = mCheckBox->isChecked() ?
config( QStringLiteral(
"CheckedState" ),
true ) :
config( QStringLiteral(
"UncheckedState" ),
false );
82 return fieldName +
" IS NULL";
85 return fieldName +
" IS NOT NULL";
87 const QVariant v =
value();
93 case QMetaType::Type::Int:
94 case QMetaType::Type::UInt:
95 case QMetaType::Type::Double:
96 case QMetaType::Type::LongLong:
97 case QMetaType::Type::ULongLong:
98 case QMetaType::Type::Bool:
101 return fieldName +
'=' + v.toString();
103 return fieldName +
"<>" + v.toString();
110 return fieldName +
"='" + v.toString() +
'\'';
112 return fieldName +
"<>'" + v.toString() +
'\'';
124 whileBlocking( mCheckBox )->setCheckState( Qt::PartiallyChecked );
132 mCheckBox->setEnabled( enabled );
150 case QMetaType::Type::Bool:
151 case QMetaType::Type::Int:
152 case QMetaType::Type::UInt:
153 case QMetaType::Type::LongLong:
154 case QMetaType::Type::ULongLong:
155 case QMetaType::Type::Double:
160 str = QStringLiteral(
"%1 = '%2'" )
167void QgsCheckboxSearchWidgetWrapper::stateChanged(
int )
171 mCheckBox->setTristate(
false );
174 const QVariant currentValue =
value();
175 if ( currentValue.userType() == QMetaType::Type::Bool )
177 exp = currentValue.toBool() ? QStringLiteral(
"TRUE" ) : QStringLiteral(
"FALSE" );
181 exp = currentValue.toString();
192 QCheckBox *
c =
new QCheckBox( parent );
193 c->setChecked( Qt::PartiallyChecked );
199 mCheckBox = qobject_cast<QCheckBox *>( editor );
203 mCheckBox->setChecked( Qt::PartiallyChecked );
204 connect( mCheckBox, &QCheckBox::stateChanged,
this, &QgsCheckboxSearchWidgetWrapper::stateChanged );
static QString quotedColumnRef(QString name)
Returns a quoted column reference (in double quotes).
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 dataset.
As part of the API refactoring and improvements which landed in the Processing API was substantially reworked from the x version This was done in order to allow much of the underlying Processing framework to be ported into c
QgsSignalBlocker< Object > whileBlocking(Object *object)
Temporarily blocks signals from a QObject while calling a single method from the object.