26#include "moc_qgscheckboxsearchwidgetwrapper.cpp"
28using namespace Qt::StringLiterals;
54 if ( fieldType == QMetaType::Type::Bool )
56 v = mCheckBox->isChecked();
60 v = mCheckBox->isChecked() ?
config( u
"CheckedState"_s,
true ) :
config( u
"UncheckedState"_s,
false );
85 return fieldName +
" IS NULL";
88 return fieldName +
" IS NOT NULL";
90 const QVariant v =
value();
96 case QMetaType::Type::Int:
97 case QMetaType::Type::UInt:
98 case QMetaType::Type::Double:
99 case QMetaType::Type::LongLong:
100 case QMetaType::Type::ULongLong:
101 case QMetaType::Type::Bool:
104 return fieldName +
'=' + v.toString();
106 return fieldName +
"<>" + v.toString();
113 return fieldName +
"='" + v.toString() +
'\'';
115 return fieldName +
"<>'" + v.toString() +
'\'';
127 whileBlocking( mCheckBox )->setCheckState( Qt::PartiallyChecked );
135 mCheckBox->setEnabled( enabled );
153 case QMetaType::Type::Bool:
154 case QMetaType::Type::Int:
155 case QMetaType::Type::UInt:
156 case QMetaType::Type::LongLong:
157 case QMetaType::Type::ULongLong:
158 case QMetaType::Type::Double:
170void QgsCheckboxSearchWidgetWrapper::stateChanged(
int )
174 mCheckBox->setTristate(
false );
177 const QVariant currentValue =
value();
178 if ( currentValue.userType() == QMetaType::Type::Bool )
180 exp = currentValue.toBool() ? u
"TRUE"_s : u
"FALSE"_s;
184 exp = currentValue.toString();
195 QCheckBox *
c =
new QCheckBox( parent );
196 c->setChecked( Qt::PartiallyChecked );
202 mCheckBox = qobject_cast<QCheckBox *>( editor );
206 mCheckBox->setChecked( Qt::PartiallyChecked );
207 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.