QGIS API Documentation
3.14.0-Pi (9f7028fd23)
|
Go to the documentation of this file.
27 #include <QStringListModel>
53 if ( fkeys.isEmpty() )
60 Q_ASSERT( fieldPairs.count() == fkeys.count() );
61 for (
int i = 0; i < fieldPairs.count(); i++ )
63 if ( fieldPairs.at( i ).referencingField() ==
layer()->fields().at(
fieldIndex() ).name() )
82 return fieldName +
" IS NULL";
84 return fieldName +
" IS NOT NULL";
94 case QVariant::Double:
95 case QVariant::LongLong:
96 case QVariant::ULongLong:
99 return fieldName +
'=' + v.toString();
101 return fieldName +
"<>" + v.toString();
108 return fieldName +
"='" + v.toString() +
'\'';
110 return fieldName +
"<>'" + v.toString() +
'\'';
130 mWidget->setEnabled( enabled );
141 onValuesChanged( QVariantList() <<
value );
144 void QgsRelationReferenceSearchWidgetWrapper::onValuesChanged(
const QVariantList &values )
146 if ( !values.isEmpty() )
155 QVariant
value = values.at( 0 );
169 if ( exp == nullValue )
175 str = QStringLiteral(
"%1 = '%3'" )
177 exp.replace(
'\'', QLatin1String(
"''" ) )
190 mWidget = qobject_cast<QgsRelationReferenceWidget *>( editor );
203 if (
config( QStringLiteral(
"FilterFields" ), QVariant() ).isValid() )
QgsRelationManager relationManager
static QgsProject * instance()
Returns the QgsProject singleton instance.
Q_INVOKABLE QgsRelation relation(const QString &id) const
Gets access to a relation by its id.
QgsFields fields() const FINAL
Returns the list of fields of this layer.
static QString nullRepresentation()
This string is used to represent the value NULL throughout QGIS.
QList< QgsRelation::FieldPair > fieldPairs() const
Returns the field pairs which form this relation The first element of each pair are the field names o...
static QString quotedColumnRef(QString name)
Returns a quoted column reference (in double quotes)
QgsField at(int i) const
Gets field at particular index (must be in range 0..N-1)