QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
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() )
87 return fieldName +
" IS NULL";
89 return fieldName +
" IS NOT NULL";
99 case QVariant::Double:
100 case QVariant::LongLong:
101 case QVariant::ULongLong:
106 return fieldName +
" IS NULL";
107 return fieldName +
'=' + v.toString();
112 return fieldName +
" IS NOT NULL";
113 return fieldName +
"<>" + v.toString();
121 return fieldName +
"='" + v.toString() +
'\'';
123 return fieldName +
"<>'" + v.toString() +
'\'';
143 mWidget->setEnabled( enabled );
154 onValuesChanged( QVariantList() <<
value );
157 void QgsRelationReferenceSearchWidgetWrapper::onValuesChanged(
const QVariantList &values )
159 if ( values.isEmpty() )
168 QVariant
value = values.at( 0 );
182 if ( exp == nullValue )
188 str = QStringLiteral(
"%1 = '%3'" )
190 exp.replace(
'\'', QLatin1String(
"''" ) )
203 mWidget = qobject_cast<QgsRelationReferenceWidget *>( editor );
216 if (
config( QStringLiteral(
"FilterFields" ), QVariant() ).isValid() )
227 mWidget->
setRelation( relation,
config( QStringLiteral(
"AllowNULL" ) ).toBool() );
QgsRelationManager * relationManager
Map canvas is a class for displaying all GIS data types on a canvas.
static QgsProject * instance()
Returns the QgsProject singleton instance.
Q_INVOKABLE QgsRelation relation(const QString &id) const
Gets access to a relation by its id.
This class is a composition of two QSettings instances:
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 > referencingRelations(int idx) const
Returns the layer's relations, where the foreign key is on this layer.
QList< QgsRelation::FieldPair > fieldPairs() const
Returns the field pairs which form this relation The first element of each pair are the field names o...
Represents a vector layer which manages a vector based data sets.
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)