Class: QgsRendererWidget¶
- class qgis.gui.QgsRendererWidget¶
Bases:
QgsPanelWidget
Base class for renderer settings widgets.
WORKFLOW:
open renderer dialog with some RENDERER (never null!)
find out which widget to use
instantiate it and set in stacked widget
on any change of renderer type, create some default (dummy?) version and change the stacked widget
when clicked OK/Apply, get the renderer from active widget and clone it for the layer
Methods
This method should be called whenever the renderer is actually set on the layer.
Change marker angles of selected symbols
Change color of selected symbols
Change opacity of selected symbols
Change marker sizes of selected symbols
Change units mm/map units of selected symbols
Change line widths of selected symbols
Returns the context in which the renderer widget is shown, e.g., the associated map canvas and expression contexts.
- param p:
Creates widget to setup data-defined size legend.
Overridden key press event to handle the esc event on the widget.
Pastes the clipboard symbol over selected items.
Returns pointer to the renderer (no transfer of ownership)
Subclasses may provide the capability of changing multiple symbols at once by implementing the following two methods and by connecting the slot contextMenuViewCategories(const QPoint&).
Sets the context in which the renderer widget is shown, e.g., the associated map canvas and expression contexts.
- param dockMode:
Sets the symbol levels for the renderer defined in the widget.
Show a dialog with renderer's symbol level settings.
Returns the vector layer associated with the widget.
Signals
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
- actionEvent(self, QActionEvent)¶
- apply()¶
- applyChanges(self)¶
This method should be called whenever the renderer is actually set on the layer.
- changeEvent(self, QEvent)¶
- changeSymbolAngle(self)¶
Change marker angles of selected symbols
- changeSymbolColor(self)¶
Change color of selected symbols
- changeSymbolOpacity(self)¶
Change opacity of selected symbols
- changeSymbolSize(self)¶
Change marker sizes of selected symbols
- changeSymbolUnit(self)¶
Change units mm/map units of selected symbols
- changeSymbolWidth(self)¶
Change line widths of selected symbols
- childEvent(self, QChildEvent)¶
- closeEvent(self, QCloseEvent)¶
- connectNotify(self, QMetaMethod)¶
- context(self) QgsSymbolWidgetContext ¶
Returns the context in which the renderer widget is shown, e.g., the associated map canvas and expression contexts.
See also
New in version 3.0.
- Return type:
- contextMenuEvent(self, QContextMenuEvent)¶
- contextMenuViewCategories(self, p: QPoint)¶
- Parameters:
p (QPoint) –
- copy(self)¶
- create(self, window: PyQt5.sip.voidptr = 0, initializeWindow: bool = True, destroyOldWindow: bool = True)¶
- createDataDefinedSizeLegendWidget(self, symbol: QgsMarkerSymbol, ddsLegend: QgsDataDefinedSizeLegend) QgsDataDefinedSizeLegendWidget ¶
Creates widget to setup data-defined size legend. Returns newly created panel - may be
None
if it could not be opened. Ownership is transferred to the caller.New in version 3.0.
- Parameters:
symbol (QgsMarkerSymbol) –
ddsLegend (QgsDataDefinedSizeLegend) –
- Return type:
- 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.
- Parameters:
event – The key event
- keyReleaseEvent(self, QKeyEvent)¶
- layerVariablesChanged¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Parameters:
name (str = ...) –
revision (int = ...) –
arguments (Sequence = ...) –
- Return type:
PYQT_SIGNAL
- 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)¶
- paste(self)¶
- pasteSymbolToSelection(self)¶
Pastes the clipboard symbol over selected items.
New in version 3.10.
- receivers(self, PYQT_SIGNAL) int ¶
- refreshSymbolView(self)¶
- renderer(self) QgsFeatureRenderer ¶
Returns pointer to the renderer (no transfer of ownership)
- Return type:
- resizeEvent(self, QResizeEvent)¶
- selectedSymbols(self) List[QgsSymbol] ¶
Subclasses may provide the capability of changing multiple symbols at once by implementing the following two methods and by connecting the slot contextMenuViewCategories(const QPoint&).
- Return type:
List[QgsSymbol]
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setContext(self, context: QgsSymbolWidgetContext)¶
Sets the context in which the renderer widget is shown, e.g., the associated map canvas and expression contexts.
- Parameters:
context (QgsSymbolWidgetContext) – symbol widget context
See also
New in version 3.0.
- setDockMode(self, dockMode: bool)¶
- Parameters:
dockMode (bool) –
- setSymbolLevels(self, levels: Iterable[QgsLegendSymbolItem], enabled: bool)¶
Sets the symbol levels for the renderer defined in the widget.
The
levels
argument defines the updated list of symbols with rendering passes set.The
enabled
arguments specifies if symbol levels should be enabled for the renderer.New in version 3.20.
- Parameters:
levels (Iterable[QgsLegendSymbolItem]) –
enabled (bool) –
- showEvent(self, QShowEvent)¶
- showSymbolLevelsDialog(self, r: QgsFeatureRenderer)¶
Show a dialog with renderer’s symbol level settings.
- Parameters:
r (QgsFeatureRenderer) –
- symbolLevelsChanged¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Parameters:
name (str = ...) –
revision (int = ...) –
arguments (Sequence = ...) –
- Return type:
PYQT_SIGNAL
- tabletEvent(self, QTabletEvent)¶
- timerEvent(self, QTimerEvent)¶
- updateMicroFocus(self)¶
- vectorLayer(self) QgsVectorLayer ¶
Returns the vector layer associated with the widget.
New in version 2.12.
- Return type:
- wheelEvent(self, QWheelEvent)¶