Class: QgsSymbolLevelsWidget

class qgis.gui.QgsSymbolLevelsWidget

Bases: QgsPanelWidget

A widget which allows the user to modify the rendering order of symbol layers.

New in version 3.0.

QgsSymbolLevelsWidget(renderer: QgsFeatureRenderer, usingSymbolLevels: bool, parent: QWidget = None) Constructor for QgsSymbolLevelsWidget

QgsSymbolLevelsWidget(symbols: Iterable[QgsLegendSymbolItem], usingSymbolLevels: bool, parent: QWidget = None) Constructor for QgsSymbolLevelsWidget, which takes a list of symbols to show in the dialog.

actionEvent(self, QActionEvent)

Apply button.

Deprecated since version QGIS: 3.20. Use symbolLevels() and manually apply the changes to the renderer as appropriate.

changeEvent(self, QEvent)
childEvent(self, QChildEvent)
closeEvent(self, QCloseEvent)
connectNotify(self, QMetaMethod)
contextMenuEvent(self, QContextMenuEvent)
create(self, window: PyQt5.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
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, event: QKeyEvent)

Overridden key press event to handle the esc event on the widget.


event – The key event

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], PyQt5.sip.voidptr) Tuple[bool, int]
paintEvent(self, QPaintEvent)
receivers(self, PYQT_SIGNAL) int
resizeEvent(self, QResizeEvent)
sender(self) QObject
senderSignalIndex(self) int
setForceOrderingEnabled(self, enabled: bool)

Sets whether the level ordering is always forced on and hide the checkbox (used by rule-based renderer)


enabled (bool) – toggle level ordering

sharedPainter(self) QPainter
showEvent(self, QShowEvent)
symbolLevels(self) List[QgsLegendSymbolItem]

Returns the current legend symbols with rendering passes set, as defined in the widget.

New in version 3.20.

Return type:


tabletEvent(self, QTabletEvent)
timerEvent(self, QTimerEvent)
usingLevels(self) bool

Returns whether the level ordering is enabled

Return type:


wheelEvent(self, QWheelEvent)