Class: QgsExpressionSelectionDialog

class qgis.gui.QgsExpressionSelectionDialog(layer: QgsVectorLayer, startText: str = '', parent: QWidget = None)

Bases: PyQt5.QtWidgets.QDialog

Creates a new selection dialog.

Parameters
  • layer – The layer on which the selection is to be performed.

  • startText – A default expression text to be applied (Defaults to empty)

  • parent – parent object (owner)

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.

Methods

actionEvent

changeEvent

childEvent

closeEvent

Implementation for closeEvent Saves the window geometry

connectNotify

contextMenuEvent

create

customEvent

destroy

disconnectNotify

done

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

dragEnterEvent

dragLeaveEvent

dragMoveEvent

dropEvent

enterEvent

event

eventFilter

expressionBuilder

The builder widget that is used by the dialog

expressionText

Returns the current expression text

focusInEvent

focusNextChild

focusNextPrevChild

focusOutEvent

focusPreviousChild

hideEvent

initPainter

inputMethodEvent

isSignalConnected

keyPressEvent

keyReleaseEvent

leaveEvent

metric

mouseDoubleClickEvent

mouseMoveEvent

mousePressEvent

mouseReleaseEvent

moveEvent

nativeEvent

paintEvent

receivers

resizeEvent

sender

senderSignalIndex

setExpressionText

Sets the current expression text

setGeomCalculator

Sets geometry calculator used in distance/area calculations.

setMapCanvas

Sets a map canvas associated with the dialog.

setMessageBar

Sets the message bar to display feedback from the dialog.

sharedPainter

showEvent

tabletEvent

timerEvent

updateMicroFocus

wheelEvent

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)