Class: QgsExpressionSelectionDialog

class qgis.gui.QgsExpressionSelectionDialog

Bases: PyQt5.QtWidgets.QDialog

This class offers a dialog to change feature selections. To do so, a QgsExpressionBuilderWidget is shown in a dialog. It offers the possibilities to create a new selection, add to the current selection remove from the current selection or select within the current selection.

QgsExpressionSelectionDialog(layer: QgsVectorLayer, startText: str = ‘’, parent: QWidget = None) Creates a new selection dialog.

Parameters
actionEvent(self, QActionEvent)
changeEvent(self, QEvent)
childEvent(self, QChildEvent)
closeEvent(self, closeEvent: QCloseEvent)

Implementation for closeEvent Saves the window geometry

Parameters

closeEvent (QCloseEvent) – Event object. Unused.

connectNotify(self, QMetaMethod)
contextMenuEvent(self, QContextMenuEvent)
create(self, window: sip.voidptr = 0, initializeWindow: bool = True, destroyOldWindow: bool = True)
customEvent(self, QEvent)
destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)
disconnectNotify(self, QMetaMethod)
done(self, r: int)

Implementation for done (default behavior when pressing esc) Calls close, so the window geometry gets saved and the object deleted.

Parameters

r (int) – Result value. Unused.

dragEnterEvent(self, QDragEnterEvent)
dragLeaveEvent(self, QDragLeaveEvent)
dragMoveEvent(self, QDragMoveEvent)
dropEvent(self, QDropEvent)
enterEvent(self, QEvent)
event(self, QEvent) bool
eventFilter(self, QObject, QEvent) bool
expressionBuilder(self) QgsExpressionBuilderWidget

The builder widget that is used by the dialog

Return type

QgsExpressionBuilderWidget

Returns

The builder widget that is used by the dialog

expressionText(self) str

Returns the current expression text

Return type

str

Returns

The expression text

focusInEvent(self, QFocusEvent)
focusNextChild(self) bool
focusNextPrevChild(self, bool) bool
focusOutEvent(self, QFocusEvent)
focusPreviousChild(self) bool
hideEvent(self, QHideEvent)
initPainter(self, QPainter)
inputMethodEvent(self, QInputMethodEvent)
isSignalConnected(self, QMetaMethod) bool
keyPressEvent(self, QKeyEvent)
keyReleaseEvent(self, QKeyEvent)
leaveEvent(self, QEvent)
metric(self, QPaintDevice.PaintDeviceMetric) int
mouseDoubleClickEvent(self, QMouseEvent)
mouseMoveEvent(self, QMouseEvent)
mousePressEvent(self, QMouseEvent)
mouseReleaseEvent(self, QMouseEvent)
moveEvent(self, QMoveEvent)
nativeEvent(self, Union[QByteArray, bytes, bytearray], sip.voidptr) Tuple[bool, int]
paintEvent(self, QPaintEvent)
receivers(self, PYQT_SIGNAL) int
resizeEvent(self, QResizeEvent)
sender(self) QObject
senderSignalIndex(self) int
setExpressionText(self, text: str)

Sets the current expression text

Parameters

text (str) – the expression text to set

setGeomCalculator(self, da: QgsDistanceArea)

Sets geometry calculator used in distance/area calculations.

Parameters

da (QgsDistanceArea) –

setMapCanvas(self, canvas: QgsMapCanvas)

Sets a map canvas associated with the dialog.

New in version 3.0.

Parameters

canvas (QgsMapCanvas) –

setMessageBar(self, messageBar: QgsMessageBar)

Sets the message bar to display feedback from the dialog. This is used when zooming to features to display the count of selected features.

Parameters

messageBar (QgsMessageBar) – target message bar

New in version 3.0.

sharedPainter(self) QPainter
showEvent(self, QShowEvent)
tabletEvent(self, QTabletEvent)
timerEvent(self, QTimerEvent)
updateMicroFocus(self)
wheelEvent(self, QWheelEvent)