26#include "moc_qgscheckboxsearchwidgetwrapper.cpp"
28using namespace Qt::StringLiterals;
53 if ( fieldType == QMetaType::Type::Bool )
55 v = mCheckBox->isChecked();
59 v = mCheckBox->isChecked() ?
config( u
"CheckedState"_s,
true ) :
config( u
"UncheckedState"_s,
false );
84 return fieldName +
" IS NULL";
87 return fieldName +
" IS NOT NULL";
89 const QVariant v =
value();
95 case QMetaType::Type::Int:
96 case QMetaType::Type::UInt:
97 case QMetaType::Type::Double:
98 case QMetaType::Type::LongLong:
99 case QMetaType::Type::ULongLong:
100 case QMetaType::Type::Bool:
103 return fieldName +
'=' + v.toString();
105 return fieldName +
"<>" + v.toString();
112 return fieldName +
"='" + v.toString() +
'\'';
114 return fieldName +
"<>'" + v.toString() +
'\'';
126 whileBlocking( mCheckBox )->setCheckState( Qt::PartiallyChecked );
134 mCheckBox->setEnabled( enabled );
152 case QMetaType::Type::Bool:
153 case QMetaType::Type::Int:
154 case QMetaType::Type::UInt:
155 case QMetaType::Type::LongLong:
156 case QMetaType::Type::ULongLong:
157 case QMetaType::Type::Double:
168void QgsCheckboxSearchWidgetWrapper::stateChanged(
int )
172 mCheckBox->setTristate(
false );
175 const QVariant currentValue =
value();
176 if ( currentValue.userType() == QMetaType::Type::Bool )
178 exp = currentValue.toBool() ? u
"TRUE"_s : u
"FALSE"_s;
182 exp = currentValue.toString();
193 QCheckBox *
c =
new QCheckBox( parent );
194 c->setChecked( Qt::PartiallyChecked );
200 mCheckBox = qobject_cast<QCheckBox *>( editor );
204 mCheckBox->setChecked( Qt::PartiallyChecked );
205 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.