25 , mMessageBar( messageBar )
26 , mIndeterminateState( false )
50 bool showForm =
config( QStringLiteral(
"ShowForm" ),
false ).toBool();
51 bool mapIdent =
config( QStringLiteral(
"MapIdentification" ),
false ).toBool();
52 bool readOnlyWidget =
config( QStringLiteral(
"ReadOnly" ),
false ).toBool();
53 bool orderByValue =
config( QStringLiteral(
"OrderByValue" ),
false ).toBool();
54 bool showOpenFormButton =
config( QStringLiteral(
"ShowOpenFormButton" ),
true ).toBool();
61 if (
config( QStringLiteral(
"FilterFields" ), QVariant() ).isValid() )
68 const QVariant relationName =
config( QStringLiteral(
"Relation" ) );
71 if ( relationName.isValid() )
91 mWidget->
setRelation( relation,
config( QStringLiteral(
"AllowNULL" ) ).toBool() );
99 return QVariant(
field().type() );
105 return QVariant(
field().type() );
124 mIndeterminateState =
true;
129 if ( !mWidget || ( !mIndeterminateState && val ==
value() && val.isNull() ==
value().isNull() ) )
132 mIndeterminateState =
false;
144 void QgsRelationReferenceWidgetWrapper::foreignKeyChanged( QVariant
value )
146 if ( !value.isValid() || value.isNull() )
148 value = QVariant(
field().type() );
159 widget()->setStyleSheet( QString() );
166 mWidget->setStyleSheet( QString() );
170 mWidget->setStyleSheet( QStringLiteral(
".QComboBox { background-color: #dd7777; }" ) );
174 mWidget->setStyleSheet( QStringLiteral(
".QComboBox { background-color: #ffd85d; }" ) );
This class contains context information for attribute editor widgets.
A bar for displaying non-blocking messages to the user.
Map canvas is a class for displaying all GIS data types on a canvas.
QList< QgsRelation > referencingRelations(int idx) const
Returns the layer's relations, where the foreign key is on this layer.
const QgsRelation & relation() const
Returns the attribute relation.
QgsRelationManager relationManager
const QgsAttributeEditorContext * parentContext() const
static QgsProject * instance()
Returns the QgsProject singleton instance.
Q_INVOKABLE QgsRelation relation(const QString &id) const
Gets access to a relation by its id.
Represents a vector layer which manages a vector based data sets.