QgsMapLayerConfigWidgetFactory class

Factory class for creating custom map layer property pages.

Constructors, destructors, conversion operators

QgsMapLayerConfigWidgetFactory() defaulted
Constructor.
QgsMapLayerConfigWidgetFactory(const QString& title, const QIcon& icon)
Constructor.

Public functions

auto createWidget(QgsMapLayer* layer, QgsMapCanvas* canvas, bool dockWidget = true, QWidget* parent = nullptr) const -> QgsMapLayerConfigWidget* pure virtual
Factory function to create the widget on demand as needed by the dock.
auto icon() const -> QIcon virtual
The icon that will be shown in the UI for the panel.
void setIcon(const QIcon& icon)
Set the icon for the factory object.
void setSupportLayerPropertiesDialog(bool supports)
Set support flag for style dock.
void setSupportsStyleDock(bool supports)
Set support flag for style dock.
void setTitle(const QString& title)
Set the title for the interface.
auto supportLayerPropertiesDialog() const -> bool virtual
Flag if widget is supported for use in layer properties dialog.
auto supportsLayer(QgsMapLayer* layer) const -> bool virtual
Check if the layer is supported for this widget.
auto supportsStyleDock() const -> bool virtual
Flag if widget is supported for use in style dock.
auto title() const -> QString virtual
The title of the panel.

Function documentation

QgsMapLayerConfigWidget* QgsMapLayerConfigWidgetFactory::createWidget(QgsMapLayer* layer, QgsMapCanvas* canvas, bool dockWidget = true, QWidget* parent = nullptr) const pure virtual

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.

QIcon QgsMapLayerConfigWidgetFactory::icon() const virtual

The icon that will be shown in the UI for the panel.

Returns A QIcon for the panel icon.

void QgsMapLayerConfigWidgetFactory::setIcon(const QIcon& icon)

Set the icon for the factory object.

Parameters
icon The icon to show in the interface.

void QgsMapLayerConfigWidgetFactory::setSupportLayerPropertiesDialog(bool supports)

Set support flag for style dock.

Parameters
supports True if this widget is supported in the style dock.

void QgsMapLayerConfigWidgetFactory::setSupportsStyleDock(bool supports)

Set support flag for style dock.

Parameters
supports True if this widget is supported in the style dock.

void QgsMapLayerConfigWidgetFactory::setTitle(const QString& title)

Set the title for the interface.

Parameters
title The title to set.

bool QgsMapLayerConfigWidgetFactory::supportLayerPropertiesDialog() const virtual

Flag if widget is supported for use in layer properties dialog.

Returns True if supported

The default implementation returns false.

bool QgsMapLayerConfigWidgetFactory::supportsLayer(QgsMapLayer* layer) const virtual

Check if the layer is supported for this widget.

Returns True if this layer is supported for this widget

bool QgsMapLayerConfigWidgetFactory::supportsStyleDock() const virtual

Flag if widget is supported for use in style dock.

Returns True if supported

The default implementation returns false.

QString QgsMapLayerConfigWidgetFactory::title() const virtual

The title of the panel.

Returns Title of the panel