Class: QgsFieldComboBox¶
-
class
qgis.gui.
QgsFieldComboBox
(parent: QWidget = None)¶ Bases:
PyQt5.QtWidgets.QComboBox
QgsFieldComboBox creates a combo box to display the fields of a layer. The layer can be either manually given or dynamically set by connecting the signal QgsMapLayerComboBox.layerChanged to the slot setLayer.
The QgsFieldComboBox is a combo box which displays the list of fields of a given layer. It might be combined with a QgsMapLayerComboBox to automatically update fields according to a chosen layer. If expression must be used, QgsFieldExpressionWidget shall be used instead.
See also
New in version 2.3: Enums
Methods
Returns
True
if the combo box allows the empty field (“not set”) choice.Returns the currently selected field
currently used filter on list of fields
Returns the layer currently associated with the combobox.
Sets whether an optional empty field (“not set”) option is shown in the combo box.
setField sets the currently selected field
setFilters allows fitering according to the type of field
Sets the layer for which fields are listed in the combobox.
Signals
Emitted when the currently selected field changes.
Attributes
-
actionEvent
()¶
-
allowEmptyFieldName
(self) → bool¶ Returns
True
if the combo box allows the empty field (“not set”) choice.See also
New in version 3.0.
-
changeEvent
()¶
-
childEvent
()¶
-
closeEvent
()¶
-
connectNotify
()¶
-
contextMenuEvent
()¶
-
create
()¶
-
currentField
(self) → str¶ Returns the currently selected field
-
customEvent
()¶
-
destroy
()¶
-
disconnectNotify
()¶
-
dragEnterEvent
()¶
-
dragLeaveEvent
()¶
-
dragMoveEvent
()¶
-
dropEvent
()¶
-
enterEvent
()¶
-
fieldChanged
¶ Emitted when the currently selected field changes. [signal]
-
filters
(self) → QgsFieldProxyModel.Filters¶ currently used filter on list of fields
-
focusInEvent
()¶
-
focusNextChild
()¶
-
focusNextPrevChild
()¶
-
focusOutEvent
()¶
-
focusPreviousChild
()¶
-
hideEvent
()¶
-
indexChanged
(self, i: int)¶
-
initPainter
()¶
-
initStyleOption
()¶
-
inputMethodEvent
()¶
-
isSignalConnected
()¶
-
keyPressEvent
()¶
-
keyReleaseEvent
()¶
-
layer
(self) → QgsVectorLayer¶ Returns the layer currently associated with the combobox.
See also
-
leaveEvent
()¶
-
metric
()¶
-
mouseDoubleClickEvent
()¶
-
mouseMoveEvent
()¶
-
mousePressEvent
()¶
-
mouseReleaseEvent
()¶
-
moveEvent
()¶
-
nativeEvent
()¶
-
paintEvent
()¶
-
receivers
()¶
-
resizeEvent
()¶
-
sender
()¶
-
senderSignalIndex
()¶
-
setAllowEmptyFieldName
(self, allowEmpty: bool)¶ Sets whether an optional empty field (“not set”) option is shown in the combo box.
See also
New in version 3.0.
-
setField
(self, fieldName: str)¶ setField sets the currently selected field
-
setFilters
(self, filters: Union[QgsFieldProxyModel.Filters, QgsFieldProxyModel.Filter])¶ setFilters allows fitering according to the type of field
-
setLayer
(self, layer: QgsMapLayer)¶ Sets the layer for which fields are listed in the combobox. If no layer is set or a non-vector layer is set then the combobox will be empty.
See also
-
showEvent
()¶
-
tabletEvent
()¶
-
timerEvent
()¶
-
updateMicroFocus
()¶
-
wheelEvent
()¶
-