Subgroup: Map
Class: QgsMapLayerConfigWidgetFactory¶
-
class
qgis.gui.
QgsMapLayerConfigWidgetFactory
¶ Bases:
sip.wrapper
New in version 2.16.
Factory class for creating custom map layer property pages
Methods
createWidget
Factory function to create the widget on demand as needed by the dock. icon
The icon that will be shown in the UI for the panel. setIcon
Set the icon for the factory object. setSupportLayerPropertiesDialog
Set support flag for style dock setSupportsStyleDock
Set support flag for style dock setTitle
Set the title for the interface supportLayerPropertiesDialog
Flag if widget is supported for use in layer properties dialog. supportsLayer
Check if the layer is supported for this widget. supportsStyleDock
Flag if widget is supported for use in style dock. title
The title of the panel. Attributes
-
createWidget
(self, layer: QgsMapLayer, canvas: QgsMapCanvas, dockWidget: bool = True, parent: QWidget = None) → QgsMapLayerConfigWidget¶ Factory function to create the widget on demand as needed by the dock.
Parameters: - layer – The active layer in the dock.
- canvas – The map canvas.
- dockWidget – True of the widget will be shown a dock style widget.
- parent – The parent of the widget.
Returns: A new QgsMapStylePanel which is shown in the map style dock.
Note
This function is called each time the panel is selected. Keep it light for better UX.
-
icon
(self) → QIcon¶ The icon that will be shown in the UI for the panel.
Returns: A QIcon for the panel icon.
-
setIcon
(self, icon: QIcon)¶ Set the icon for the factory object.
Parameters: icon – The icon to show in the interface.
-
setSupportLayerPropertiesDialog
(self, supports: bool)¶ Set support flag for style dock
Parameters: supports – True if this widget is supported in the style dock.
-
setSupportsStyleDock
(self, supports: bool)¶ Set support flag for style dock
Parameters: supports – True if this widget is supported in the style dock.
-
setTitle
(self, title: str)¶ Set the title for the interface
Note
Not all users may show this as a label e.g style dock uses this as a tooltip.
Parameters: title – The title to set.
-
supportLayerPropertiesDialog
(self) → bool¶ Flag if widget is supported for use in layer properties dialog. The default implementation returns false.
Returns: True if supported
-
supportsLayer
(self, layer: QgsMapLayer) → bool¶ Check if the layer is supported for this widget.
Returns: True if this layer is supported for this widget
-
supportsStyleDock
(self) → bool¶ Flag if widget is supported for use in style dock. The default implementation returns false.
Returns: True if supported
-
title
(self) → str¶ The title of the panel.
Returns: Title of the panel Note
This may or may not be shown to the user.
-