Class: QgsRelationReferenceWidget

class qgis.gui.QgsRelationReferenceWidget(parent: QWidget)

Bases: PyQt5.QtWidgets.QWidget

Parameters

parent

class CanvasExtent

Bases: int

Fixed = 0
Pan = 1
Scale = 2
actionEvent()
allowAddFeatures(self) → bool

Determines if a button for adding new features should be shown.

New in version 2.16.

Return type

bool

allowMapIdentification(self) → bool

determines if the widget offers the possibility to select the related feature on the map (using a dedicated map tool)

Return type

bool

chainFilters(self) → bool

Determines if the filters are chained

Return type

bool

Returns

True if filters are chained

changeEvent()
childEvent()
closeEvent()
connectNotify()
contextMenuEvent()
create()
customEvent()
deleteForeignKey(self)

unset the currently related feature

destroy()
disconnectNotify()
dragEnterEvent()
dragLeaveEvent()
dragMoveEvent()
dropEvent()
embedForm(self) → bool

determines if the form of the related feature will be shown

Return type

bool

enterEvent()
event()
focusInEvent()
focusNextChild()
focusNextPrevChild()
focusOutEvent()
focusPreviousChild()
foreignKey(self) → Any

returns the related feature foreign key

Return type

Any

foreignKeyChanged

foreignKeyChanged(self, Any) [signal]

hideEvent()
init(self)
initPainter()
inputMethodEvent()
isSignalConnected()
keyPressEvent()
keyReleaseEvent()
leaveEvent()
mapIdentification(self)

activate the map tool to select a new related feature on the map

metric()
mouseDoubleClickEvent()
mouseMoveEvent()
mousePressEvent()
mouseReleaseEvent()
moveEvent()
nativeEvent()
openForm(self)

open the form of the related feature in a new dialog

openFormButtonVisible(self) → bool

determines the open form button is visible in the widget

Return type

bool

orderByValue(self) → bool

If the widget will order the combobox entries by value

Return type

bool

paintEvent()
readOnlySelector(self) → bool

determines if the foreign key is shown in a combox box or a read-only line edit

Return type

bool

receivers()
referencedFeature(self) → QgsFeature

Returns the related feature (from the referenced layer) if no feature is related, it returns an invalid feature

Return type

QgsFeature

resizeEvent()
sender()
senderSignalIndex()
setAllowAddFeatures(self, allowAddFeatures: bool)

Determines if a button for adding new features should be shown.

New in version 2.16.

Parameters

allowAddFeatures (bool) –

setAllowMapIdentification(self, allowMapIdentification: bool)
Parameters

allowMapIdentification (bool) –

setChainFilters(self, chainFilters: bool)

Set if filters are chained. Chained filters restrict the option of subsequent filters based on the selection of a previous filter.

Parameters

chainFilters (bool) – If chaining should be enabled

setEditorContext(self, context: QgsAttributeEditorContext, canvas: QgsMapCanvas, messageBar: QgsMessageBar)
Parameters
setEmbedForm(self, display: bool)
Parameters

display (bool) –

setFilterFields(self, filterFields: Iterable[str])

Sets the fields for which filter comboboxes will be created

Parameters

filterFields (Iterable[str]) –

setForeignKey(self, value: Any)

this sets the related feature using from the foreign key

Parameters

value (Any) –

setOpenFormButtonVisible(self, openFormButtonVisible: bool)
Parameters

openFormButtonVisible (bool) –

setOrderByValue(self, orderByValue: bool)

Sets if the widget will order the combobox entries by value

Parameters

orderByValue (bool) –

setReadOnlySelector(self, readOnly: bool)
Parameters

readOnly (bool) –

setRelation(self, relation: QgsRelation, allowNullValue: bool)
Parameters
setRelationEditable(self, editable: bool)
Parameters

editable (bool) –

sharedPainter()
showEvent(self, e: QShowEvent)
Parameters

e (QShowEvent) –

showIndeterminateState(self)

Sets the widget to display in an indeterminate “mixed value” state.

New in version 2.16.

tabletEvent()
timerEvent()
updateMicroFocus()
wheelEvent()