Class: QgsExpressionSelectionDialog

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

Bases: PyQt5.QtWidgets.QDialog

Creates a new selection dialog.

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

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

  • parent (QWidget = None) – 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()
changeEvent()
childEvent()
closeEvent(self, closeEvent: QCloseEvent)

Implementation for closeEvent Saves the window geometry

Parameters

closeEvent (QCloseEvent) – Event object. Unused.

connectNotify()
contextMenuEvent()
create()
customEvent()
destroy()
disconnectNotify()
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()
dragLeaveEvent()
dragMoveEvent()
dropEvent()
enterEvent()
event()
eventFilter()
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()
focusNextChild()
focusNextPrevChild()
focusOutEvent()
focusPreviousChild()
hideEvent()
initPainter()
inputMethodEvent()
isSignalConnected()
keyPressEvent()
keyReleaseEvent()
leaveEvent()
metric()
mouseDoubleClickEvent()
mouseMoveEvent()
mousePressEvent()
mouseReleaseEvent()
moveEvent()
nativeEvent()
paintEvent()
receivers()
resizeEvent()
sender()
senderSignalIndex()
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()
showEvent()
tabletEvent()
timerEvent()
updateMicroFocus()
wheelEvent()