Class: QgsLegendFilterButton

class qgis.gui.QgsLegendFilterButton

Bases: PyQt5.QtWidgets.QToolButton

A tool button that allows enabling or disabling legend filter by contents of the map. An additional pop down menu allows defining a boolean expression to refine the filtering.

New in version 2.14.

QgsLegendFilterButton(parent: QWidget = None) Construct a new filter legend button

Parameters

parent

The parent QWidget

Methods

actionEvent

changeEvent

checkStateSet

childEvent

closeEvent

connectNotify

contextMenuEvent

create

customEvent

destroy

disconnectNotify

dragEnterEvent

dragLeaveEvent

dragMoveEvent

dropEvent

enterEvent

event

expressionText

Returns the current text used as filter expression

focusInEvent

focusNextChild

focusNextPrevChild

focusOutEvent

focusPreviousChild

hideEvent

hitButton

initPainter

initStyleOption

inputMethodEvent

isSignalConnected

keyPressEvent

keyReleaseEvent

leaveEvent

metric

mouseDoubleClickEvent

mouseMoveEvent

mousePressEvent

mouseReleaseEvent

moveEvent

nativeEvent

nextCheckState

paintEvent

receivers

resizeEvent

sender

senderSignalIndex

setExpressionText

Sets the current text used as filter expression.

setVectorLayer

Sets the associated vectorLayer May be None

sharedPainter

showEvent

tabletEvent

timerEvent

updateMicroFocus

vectorLayer

Returns the current associated vectorLayer May be None

wheelEvent

Signals

expressionTextChanged

Emitted when the expression text changes [signal]

actionEvent(self, QActionEvent)
changeEvent(self, QEvent)
checkStateSet(self)
childEvent(self, QChildEvent)
closeEvent(self, QCloseEvent)
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)
dragEnterEvent(self, QDragEnterEvent)
dragLeaveEvent(self, QDragLeaveEvent)
dragMoveEvent(self, QDragMoveEvent)
dropEvent(self, QDropEvent)
enterEvent(self, QEvent)
event(self, QEvent) bool
expressionText(self) str

Returns the current text used as filter expression

Return type

str

expressionTextChanged

Emitted when the expression text changes [signal]

focusInEvent(self, QFocusEvent)
focusNextChild(self) bool
focusNextPrevChild(self, bool) bool
focusOutEvent(self, QFocusEvent)
focusPreviousChild(self) bool
hideEvent(self, QHideEvent)
hitButton(self, QPoint) bool
initPainter(self, QPainter)
initStyleOption(self, QStyleOptionToolButton)
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]
nextCheckState(self)
paintEvent(self, QPaintEvent)
receivers(self, PYQT_SIGNAL) int
resizeEvent(self, QResizeEvent)
sender(self) QObject
senderSignalIndex(self) int
setExpressionText(self, expression: str)

Sets the current text used as filter expression. This will update the menu

Parameters

expression (str) –

setVectorLayer(self, layer: QgsVectorLayer)

Sets the associated vectorLayer May be None

Parameters

layer (QgsVectorLayer) –

sharedPainter(self) QPainter
showEvent(self, QShowEvent)
tabletEvent(self, QTabletEvent)
timerEvent(self, QTimerEvent)
updateMicroFocus(self)
vectorLayer(self) QgsVectorLayer

Returns the current associated vectorLayer May be None

Return type

QgsVectorLayer

wheelEvent(self, QWheelEvent)