23 #include "qgssettings.h" 
   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     return new QComboBox( parent );
 
  213   mComboBox = qobject_cast<QComboBox *>( editor );
 
  214   mLineEdit = qobject_cast<QLineEdit *>( editor );
 
  218     mComboBox->addItem( tr( 
"Please Select" ), QVariant() ); 
 
  219     if ( 
config( QStringLiteral( 
"AllowNull" ) ).toBool() )
 
  221       mComboBox->addItem( tr( 
"(no selection)" ), QVariant( 
layer()->fields().at( 
mFieldIdx ).type() ) );
 
  224     const auto constMCache = mCache;
 
  227       mComboBox->addItem( element.value, element.key );
 
  232   else if ( mLineEdit )
 
  235     values.reserve( mCache.size() );
 
  241     QStringListModel *m = 
new QStringListModel( values, mLineEdit );
 
  242     QCompleter *completer = 
new QCompleter( m, mLineEdit );
 
  243     completer->setCaseSensitivity( Qt::CaseInsensitive );
 
  244     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...
Represents a vector layer which manages a vector based data sets.
QgsFields fields() const FINAL
Returns the list of fields of this layer.