26#include <QStringListModel> 
   51    int cbxIdx = mComboBox->currentIndex();
 
   54      v = mComboBox->currentData();
 
   60    const auto constMCache = mCache;
 
   63      if ( i.value == mLineEdit->text() )
 
   91    return fieldName + 
" IS NULL";
 
   93    return fieldName + 
" IS NOT NULL";
 
  103    case QVariant::Double:
 
  104    case QVariant::LongLong:
 
  105    case QVariant::ULongLong:
 
  108        return fieldName + 
'=' + v.toString();
 
  110        return fieldName + 
"<>" + v.toString();
 
  117        return fieldName + 
"='" + v.toString() + 
'\'';
 
  119        return fieldName + 
"<>'" + v.toString() + 
'\'';
 
  131    mComboBox->setCurrentIndex( 0 );
 
  135    mLineEdit->setText( QString() );
 
  143    mComboBox->setEnabled( enabled );
 
  147    mLineEdit->setEnabled( enabled );
 
  158  QVariant vl = 
value();
 
  179  if ( exp == nullValue )
 
  185    str = QStringLiteral( 
"%1 = '%3'" )
 
  187                exp.replace( 
'\'', QLatin1String( 
"''" ) )
 
  195  if ( 
config( QStringLiteral( 
"AllowMulti" ) ).toBool() )
 
  199  else if ( 
config( QStringLiteral( 
"UseCompleter" ) ).toBool() )
 
  205    QComboBox *combo = 
new QComboBox( parent );
 
  206    combo->setMinimumContentsLength( 1 );
 
  207    combo->setSizeAdjustPolicy( QComboBox::SizeAdjustPolicy::AdjustToMinimumContentsLengthWithIcon );
 
  216  mComboBox = qobject_cast<QComboBox *>( editor );
 
  217  mLineEdit = qobject_cast<QLineEdit *>( editor );
 
  221    mComboBox->addItem( tr( 
"Please Select" ), QVariant() ); 
 
  222    if ( 
config( QStringLiteral( 
"AllowNull" ) ).toBool() )
 
  224      mComboBox->addItem( tr( 
"(no selection)" ), QVariant( 
layer()->fields().at( 
mFieldIdx ).type() ) );
 
  227    const auto constMCache = mCache;
 
  230      mComboBox->addItem( element.value, element.key );
 
  235  else if ( mLineEdit )
 
  238    values.reserve( mCache.size() );
 
  244    QStringListModel *m = 
new QStringListModel( values, mLineEdit );
 
  245    QCompleter *completer = 
new QCompleter( m, mLineEdit );
 
  246    completer->setCaseSensitivity( Qt::CaseInsensitive );
 
  247    mLineEdit->setCompleter( completer );
 
static QString nullRepresentation()
This string is used to represent the value NULL throughout QGIS.
 
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).
 
QLineEdit subclass with built in support for clearing the widget's value and handling custom null val...
 
static bool isNull(const QVariant &variant)
Returns true if the specified variant should be considered a NULL value.
 
Represents a vector layer which manages a vector based data sets.
 
QgsFields fields() const FINAL
Returns the list of fields of this layer.