Class: QgsRelationReferenceWidgetWrapper

class qgis.gui.QgsRelationReferenceWidgetWrapper

Bases: QgsEditorWidgetWrapper

Wraps a relation reference widget.

Options: <ul> <li><b>ShowForm</b> <i>If True, an embedded form with the referenced feature will be shown.</i></li> <li><b>MapIdentification</b> <i>Will offer a map tool to pick a referenced feature on the map canvas. Only use for layers with geometry.</i></li> <li><b>ReadOnly</b> <i>If True, will represent the referenced widget in a read-only line edit. Can speed up loading.</i></li> <li><b>AllowNULL</b> <i>Will offer NULL as a value.</i></li> <li><b>Relation</b> <i>The ID of the relation that will be used to define this widget.</i></li> ReadOnly </ul>

QgsRelationReferenceWidgetWrapper(vl: QgsVectorLayer, fieldIdx: int, editor: QWidget, canvas: QgsMapCanvas, messageBar: QgsMessageBar, parent: QWidget = None) Constructor for QgsRelationReferenceWidgetWrapper

Methods

additionalFieldValues

rtype

List[Any]

additionalFields

rtype

List[str]

childEvent

connectNotify

createWidget

param parent

customEvent

disconnectNotify

formFeature

The feature currently being edited, in its current state

initWidget

param editor

isSignalConnected

receivers

sender

senderSignalIndex

setEnabled

param enabled

setFormFeature

Set the feature currently being edited to feature

setFormFeatureAttribute

Update the feature currently being edited by changing its attribute attributeName to attributeValue

showIndeterminateState

timerEvent

updateConstraintWidgetStatus

valid

rtype

bool

value

rtype

Any

additionalFieldValues(self) List[Any]
Return type

List[Any]

additionalFields(self) List[str]
Return type

List[str]

childEvent(self, QChildEvent)
connectNotify(self, QMetaMethod)
createWidget(self, parent: QWidget) QWidget
Parameters

parent (QWidget) –

Return type

QWidget

customEvent(self, QEvent)
disconnectNotify(self, QMetaMethod)
formFeature(self) QgsFeature

The feature currently being edited, in its current state

Returns

the feature currently being edited, in its current state

New in version 3.2.

initWidget(self, editor: QWidget)
Parameters

editor (QWidget) –

isSignalConnected(self, QMetaMethod) bool
receivers(self, PYQT_SIGNAL) int
sender(self) QObject
senderSignalIndex(self) int
setEnabled(self, enabled: bool)
Parameters

enabled (bool) –

setFormFeature(self, feature: QgsFeature)

Set the feature currently being edited to feature

New in version 3.2.

setFormFeatureAttribute(self, attributeName: str, attributeValue: Any) bool

Update the feature currently being edited by changing its attribute attributeName to attributeValue

Returns

bool True on success

New in version 3.2.

showIndeterminateState(self)
timerEvent(self, QTimerEvent)
updateConstraintWidgetStatus(self)
valid(self) bool
Return type

bool

value(self) Any
Return type

Any