22 #include <QHBoxLayout> 26 , mLineEdit( nullptr )
27 , mCheckbox( nullptr )
28 , mContainer( nullptr )
29 , mCaseString(
QString(
"LIKE" ) )
39 void QgsDefaultSearchWidgetWrapper::setCaseString(
int caseSensitiveCheckState )
41 if ( caseSensitiveCheckState == Qt::Checked )
47 mCaseString =
"ILIKE";
56 bool numeric = ( fldType == QVariant::Int || fldType == QVariant::Double || fldType == QVariant::LongLong );
62 if ( exp == nullValue )
70 numeric ?
"=" : mCaseString,
74 '%' + exp.
replace(
'\'',
"''" ) +
'%' );
94 mCheckbox =
new QCheckBox(
"Case sensitive" );
98 connect( mLineEdit, SIGNAL( returnPressed() ),
this, SLOT( filterChanged() ) );
99 connect( mCheckbox, SIGNAL( stateChanged(
int ) ),
this, SLOT( setCaseString(
int ) ) );
101 mCaseString =
"ILIKE";
109 void QgsDefaultSearchWidgetWrapper::filterChanged()
static QString quotedColumnRef(QString name)
Returns a quoted column reference (in double quotes)
QgsFields fields() const
Returns the list of fields of this layer.
QString name() const
Gets the name of the field.
Lineedit with builtin clear button.
const QgsField & at(int i) const
Get field at particular index (must be in range 0..N-1)
QString & replace(int position, int n, QChar after)
QVariant value(const QString &key, const QVariant &defaultValue) const
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
Represents a vector layer which manages a vector based data sets.
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const
QVariant::Type type() const
Gets variant type of the field as it will be retrieved from data source.