QGIS API Documentation 3.40.0-Bratislava (b56115d8743)
Loading...
Searching...
No Matches
qgsmaplayerconfigwidgetfactory.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsmaplayerconfigwidgetfactoryfactory.h
3 --------------------------------------
4 Date : 9.7.2013
5 Copyright : (C) 2013 Matthias Kuhn
6 Email : matthias dot kuhn at gmx dot ch
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16#ifndef QGSMAPLAYERCONFIGWIDGETFACTORY_H
17#define QGSMAPLAYERCONFIGWIDGETFACTORY_H
18
19#include <QListWidgetItem>
20#include "qgis_gui.h"
21#include "qgis_sip.h"
22
23class QgsMapLayer;
25class QgsMapCanvas;
27
34{
35 public:
36
43 enum class ParentPage : int
44 {
45 NoParent,
46 Temporal,
47 };
48
50
52 QgsMapLayerConfigWidgetFactory( const QString &title, const QIcon &icon );
53
55
60 virtual QIcon icon() const { return mIcon; }
61
66 void setIcon( const QIcon &icon ) { mIcon = icon; }
67
73 virtual QString title() const { return mTitle; }
74
81 void setTitle( const QString &title ) { mTitle = title; }
82
88 virtual bool supportsStyleDock() const { return false; }
89
94 void setSupportsStyleDock( bool supports ) { mSupportsDock = supports; }
95
101 virtual bool supportLayerPropertiesDialog() const { return false; }
102
115 virtual QString layerPropertiesPagePositionHint() const;
116
121 void setSupportLayerPropertiesDialog( bool supports ) { mSupportsProperties = supports; }
122
127 virtual bool supportsLayer( QgsMapLayer *layer ) const;
128
134 virtual bool supportsLayerTreeGroup( QgsLayerTreeGroup *group ) const;
135
144 virtual ParentPage parentPage() const;
145
155 virtual QgsMapLayerConfigWidget *createWidget( QgsMapLayer *layer, QgsMapCanvas *canvas, bool dockWidget = true, QWidget *parent = nullptr ) const = 0 SIP_FACTORY;
156
157 private:
158 QIcon mIcon;
159 QString mTitle;
160 bool mSupportsDock = true;
161 bool mSupportsProperties = true;
162};
163
164#endif // QGSMAPLAYERCONFIGWIDGETFACTORY_H
Layer tree group node serves as a container for layers and further groups.
Map canvas is a class for displaying all GIS data types on a canvas.
Factory class for creating custom map layer property pages.
virtual QIcon icon() const
The icon that will be shown in the UI for the panel.
virtual ~QgsMapLayerConfigWidgetFactory()=default
virtual QgsMapLayerConfigWidget * createWidget(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.
void setIcon(const QIcon &icon)
Set the icon for the factory object.
virtual QString title() const
The title of the panel.
void setTitle(const QString &title)
Set the title for the interface.
virtual bool supportLayerPropertiesDialog() const
Flag if widget is supported for use in layer properties dialog.
void setSupportsStyleDock(bool supports)
Set support flag for style dock.
virtual bool supportsStyleDock() const
Flag if widget is supported for use in style dock.
ParentPage
Available parent pages, for factories which create a widget which is a sub-component of a standard pa...
void setSupportLayerPropertiesDialog(bool supports)
Set support flag for style dock.
A panel widget that can be shown in the map style dock.
Base class for all map layer types.
Definition qgsmaplayer.h:76
#define SIP_FACTORY
Definition qgis_sip.h:76