QGIS API Documentation  3.6.0-Noosa (5873452)
Public Member Functions | List of all members
QgsMapLayerConfigWidgetFactory Class Referenceabstract

Factory class for creating custom map layer property pages. More...

#include <qgsmaplayerconfigwidgetfactory.h>

Public Member Functions

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

Detailed Description

Factory class for creating custom map layer property pages.

Since
QGIS 2.16

Definition at line 33 of file qgsmaplayerconfigwidgetfactory.h.

Constructor & Destructor Documentation

◆ QgsMapLayerConfigWidgetFactory() [1/2]

QgsMapLayerConfigWidgetFactory::QgsMapLayerConfigWidgetFactory ( )
default

Constructor.

◆ QgsMapLayerConfigWidgetFactory() [2/2]

QgsMapLayerConfigWidgetFactory::QgsMapLayerConfigWidgetFactory ( const QString &  title,
const QIcon &  icon 
)

Constructor.

Definition at line 18 of file qgsmaplayerconfigwidgetfactory.cpp.

◆ ~QgsMapLayerConfigWidgetFactory()

virtual QgsMapLayerConfigWidgetFactory::~QgsMapLayerConfigWidgetFactory ( )
virtualdefault

Member Function Documentation

◆ createWidget()

virtual 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
layerThe active layer in the dock.
canvasThe map canvas.
dockWidgetTrue of the widget will be shown a dock style widget.
parentThe 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()

virtual QIcon QgsMapLayerConfigWidgetFactory::icon ( ) const
inlinevirtual

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

Returns
A QIcon for the panel icon.

Definition at line 49 of file qgsmaplayerconfigwidgetfactory.h.

◆ setIcon()

void QgsMapLayerConfigWidgetFactory::setIcon ( const QIcon &  icon)
inline

Set the icon for the factory object.

Parameters
iconThe icon to show in the interface.

Definition at line 55 of file qgsmaplayerconfigwidgetfactory.h.

◆ setSupportLayerPropertiesDialog()

void QgsMapLayerConfigWidgetFactory::setSupportLayerPropertiesDialog ( bool  supports)
inline

Set support flag for style dock.

Parameters
supportsTrue if this widget is supported in the style dock.

Definition at line 96 of file qgsmaplayerconfigwidgetfactory.h.

◆ setSupportsStyleDock()

void QgsMapLayerConfigWidgetFactory::setSupportsStyleDock ( bool  supports)
inline

Set support flag for style dock.

Parameters
supportsTrue if this widget is supported in the style dock.

Definition at line 83 of file qgsmaplayerconfigwidgetfactory.h.

◆ setTitle()

void QgsMapLayerConfigWidgetFactory::setTitle ( const QString &  title)
inline

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
titleThe title to set.

Definition at line 70 of file qgsmaplayerconfigwidgetfactory.h.

◆ supportLayerPropertiesDialog()

virtual bool QgsMapLayerConfigWidgetFactory::supportLayerPropertiesDialog ( ) const
inlinevirtual

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

The default implementation returns false.

Returns
True if supported

Definition at line 90 of file qgsmaplayerconfigwidgetfactory.h.

◆ supportsLayer()

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

Definition at line 24 of file qgsmaplayerconfigwidgetfactory.cpp.

◆ supportsStyleDock()

virtual bool QgsMapLayerConfigWidgetFactory::supportsStyleDock ( ) const
inlinevirtual

Flag if widget is supported for use in style dock.

The default implementation returns false.

Returns
True if supported

Definition at line 77 of file qgsmaplayerconfigwidgetfactory.h.

◆ title()

virtual QString QgsMapLayerConfigWidgetFactory::title ( ) const
inlinevirtual

The title of the panel.

Returns
Title of the panel
Note
This may or may not be shown to the user.

Definition at line 62 of file qgsmaplayerconfigwidgetfactory.h.


The documentation for this class was generated from the following files: