Subgroup: Expression

Class: QgsExpressionBuilderDialog

class qgis.gui.QgsExpressionBuilderDialog

Bases: PyQt5.QtWidgets.QDialog

A generic dialog for building expression strings @remarks This class also shows an example on how to use QgsExpressionBuilderWidget

Methods

accept
actionEvent
allowEvalErrors Allow accepting invalid expressions.
changeEvent
childEvent
closeEvent
connectNotify
contextMenuEvent
create
customEvent
destroy
disconnectNotify
done Is called when the dialog get accepted or rejected Used to save geometry
dragEnterEvent
dragLeaveEvent
dragMoveEvent
dropEvent
enterEvent
event
eventFilter
expectedOutputFormat The set expected format string.
expressionBuilder The builder widget that is used by the dialog
expressionContext Returns the expression context for the dialog.
expressionText
focusInEvent
focusNextChild
focusNextPrevChild
focusOutEvent
focusPreviousChild
hideEvent
initPainter
inputMethodEvent
isSignalConnected
keyPressEvent
keyReleaseEvent
leaveEvent
metric
mouseDoubleClickEvent
mouseMoveEvent
mousePressEvent
mouseReleaseEvent
moveEvent
nativeEvent
paintEvent
receivers
resizeEvent
sender
senderSignalIndex
setAllowEvalErrors Allow accepting expressions with evaluation errors.
setExpectedOutputFormat The set expected format string.
setExpressionContext Sets the expression context for the dialog.
setExpressionText
setGeomCalculator Sets geometry calculator used in distance/area calculations.
sharedPainter
showEvent
tabletEvent
timerEvent
updateMicroFocus
wheelEvent

Signals

allowEvalErrorsChanged Allow accepting expressions with evaluation errors.

Attributes

accept(self)
actionEvent()
allowEvalErrors(self) → bool

Allow accepting invalid expressions. This can be useful when we are not able to provide an expression context of which we are sure it’s completely populated.

New in version 3.0.

allowEvalErrorsChanged

Allow accepting expressions with evaluation errors. This can be useful when we are not able to provide an expression context of which we are sure it’s completely populated.

New in version 3.0: [signal]

changeEvent()
childEvent()
closeEvent()
connectNotify()
contextMenuEvent()
create()
customEvent()
destroy()
disconnectNotify()
done(self, r: int)

Is called when the dialog get accepted or rejected Used to save geometry

Parameters:r – result value (unused)
dragEnterEvent()
dragLeaveEvent()
dragMoveEvent()
dropEvent()
enterEvent()
event()
eventFilter()
expectedOutputFormat(self) → str

The set expected format string. This is pure text format and no expression validation is done against it.

Returns:The expected value format.
expressionBuilder(self) → QgsExpressionBuilderWidget

The builder widget that is used by the dialog

expressionContext(self) → QgsExpressionContext

Returns the expression context for the dialog. The context is used for the expression preview result and for populating the list of available functions and variables.

New in version 2.12.

expressionText(self) → str
focusInEvent()
focusNextChild()
focusNextPrevChild()
focusOutEvent()
focusPreviousChild()
hideEvent()
initPainter()
inputMethodEvent()
isSignalConnected()
keyPressEvent()
keyReleaseEvent()
leaveEvent()
metric()
mouseDoubleClickEvent()
mouseMoveEvent()
mousePressEvent()
mouseReleaseEvent()
moveEvent()
nativeEvent()
paintEvent()
receivers()
resizeEvent()
sender()
senderSignalIndex()
setAllowEvalErrors(self, allowEvalErrors: bool)

Allow accepting expressions with evaluation errors. This can be useful when we are not able to provide an expression context of which we are sure it’s completely populated.

New in version 3.0.

setExpectedOutputFormat(self, expected: str)

The set expected format string. This is pure text format and no expression validation is done against it.

Parameters:expected – The expected value format for the expression.

Note

Only a UI hint and not used for expression validation.

setExpressionContext(self, context: QgsExpressionContext)

Sets the expression context for the dialog. The context is used for the expression preview result and for populating the list of available functions and variables.

Parameters:context – expression context

New in version 2.12.

setExpressionText(self, text: str)
setGeomCalculator(self, da: QgsDistanceArea)

Sets geometry calculator used in distance/area calculations.

sharedPainter()
showEvent()
tabletEvent()
timerEvent()
updateMicroFocus()
wheelEvent()