QGIS API Documentation 3.41.0-Master (fda2aa46e9a)
Loading...
Searching...
No Matches
qgsmaplayerconfigwidget.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsmaplayerconfigwidget.h
3 -------------------------
4 begin : June 2016
5 copyright : (C) 2016 by Nathan Woodrow
6 email : woodrow dot nathan at gmail dot com
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#ifndef QGSMAPLAYERCONFIGWIDGET_H
16#define QGSMAPLAYERCONFIGWIDGET_H
17
18#include <QWidget>
19#include <QIcon>
20#include <QPointer>
21
22#include "qgspanelwidget.h"
23#include "qgslayertreegroup.h"
24#include "qgis_gui.h"
25
26class QgsMapCanvas;
27class QgsMapLayer;
28class QgsMessageBar;
29
37{
38 public:
39
46 QString annotationId() const { return mAnnotationId; }
47
54 void setAnnotationId( const QString &id ) { mAnnotationId = id; }
55
62 void setMapCanvas( QgsMapCanvas *canvas ) { mMapCanvas = canvas; }
63
68 QgsMapCanvas *mapCanvas() const { return mMapCanvas; }
69
75 void setMessageBar( QgsMessageBar *bar ) { mMessageBar = bar; }
76
81 QgsMessageBar *messageBar() const { return mMessageBar; }
82
89 void setLayerTreeGroup( QgsLayerTreeGroup *group );
90
97 QgsLayerTreeGroup *layerTreeGroup() const;
98
99 private:
100
101 QString mAnnotationId;
102 QgsMapCanvas *mMapCanvas = nullptr;
103 QgsMessageBar *mMessageBar = nullptr;
104 QPointer< QgsLayerTreeGroup > mLayerTreeGroup = nullptr;
105
106};
107
108
115{
116 Q_OBJECT
117 public:
118
127 QgsMapLayerConfigWidget( QgsMapLayer *layer, QgsMapCanvas *canvas, QWidget *parent = nullptr );
128
135 virtual bool shouldTriggerLayerRepaint() const { return true; }
136
141 virtual void syncToLayer( QgsMapLayer *layer ) { Q_UNUSED( layer ) }
142
148 virtual void setMapLayerConfigWidgetContext( const QgsMapLayerConfigWidgetContext &context );
149
150 public slots:
151
156 virtual void apply() = 0;
157
163 virtual void focusDefaultWidget();
164
165 signals:
166
167#ifndef SIP_RUN
168
176 void dynamicTemporalControlToggled( bool enabled );
177#endif
178
179 protected:
180
181 QgsMapLayer *mLayer = nullptr;
182 QgsMapCanvas *mMapCanvas = nullptr;
184};
185
186#endif // QGSMAPLAYERCONFIGWIDGET_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.
Encapsulates the context for a QgsMapLayerConfigWidget.
void setAnnotationId(const QString &id)
Sets the item id of the target annotation, when modifying an annotation from a QgsAnnotationLayer.
void setMessageBar(QgsMessageBar *bar)
Sets the message bar associated with the widget.
QgsMessageBar * messageBar() const
Returns the message bar associated with the widget.
QgsMapCanvas * mapCanvas() const
Returns the map canvas associated with the widget.
void setMapCanvas(QgsMapCanvas *canvas)
Sets the map canvas associated with the widget.
QString annotationId() const
Returns the item ID of the target annotation, when modifying an annotation from a QgsAnnotationLayer.
A panel widget that can be shown in the map style dock.
virtual void apply()=0
Called when changes to the layer need to be made.
void dynamicTemporalControlToggled(bool enabled)
Emitted whenever the dynamic temporal control option is toggled in the associated layer properties di...
virtual void syncToLayer(QgsMapLayer *layer)
Reset to original (vector layer) values.
QgsMapLayerConfigWidgetContext mMapLayerConfigWidgetContext
virtual bool shouldTriggerLayerRepaint() const
Whether this config widget changes map layer properties in a way that triggerRepaint() should be call...
Base class for all map layer types.
Definition qgsmaplayer.h:76
A bar for displaying non-blocking messages to the user.
Base class for any widget that can be shown as a inline panel.