QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
gui
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 "qgis_gui.h"
19
#include "
qgslayertreegroup.h
"
20
#include "
qgspanelwidget.h
"
21
22
#include <QIcon>
23
#include <QPointer>
24
#include <QWidget>
25
26
class
QgsMapCanvas
;
27
class
QgsMapLayer
;
28
class
QgsMessageBar
;
29
36
class
GUI_EXPORT
QgsMapLayerConfigWidgetContext
37
{
38
public
:
45
QString
annotationId
()
const
{
return
mAnnotationId; }
46
53
void
setAnnotationId
(
const
QString &
id
) { mAnnotationId = id; }
54
61
void
setMapCanvas
(
QgsMapCanvas
*canvas ) { mMapCanvas = canvas; }
62
67
QgsMapCanvas
*
mapCanvas
()
const
{
return
mMapCanvas; }
68
74
void
setMessageBar
(
QgsMessageBar
*bar ) { mMessageBar = bar; }
75
80
QgsMessageBar
*
messageBar
()
const
{
return
mMessageBar; }
81
88
void
setLayerTreeGroup(
QgsLayerTreeGroup
*group );
89
96
QgsLayerTreeGroup
*layerTreeGroup()
const
;
97
98
private
:
99
QString mAnnotationId;
100
QgsMapCanvas
*mMapCanvas =
nullptr
;
101
QgsMessageBar
*mMessageBar =
nullptr
;
102
QPointer<QgsLayerTreeGroup> mLayerTreeGroup =
nullptr
;
103
};
104
105
111
class
GUI_EXPORT
QgsMapLayerConfigWidget
:
public
QgsPanelWidget
112
{
113
Q_OBJECT
114
public
:
123
QgsMapLayerConfigWidget
(
QgsMapLayer
*
layer
,
QgsMapCanvas
*canvas, QWidget *parent =
nullptr
);
124
130
QgsMapLayer
*
layer
();
131
138
virtual
bool
shouldTriggerLayerRepaint
()
const
{
return
true
; }
139
140
#ifdef __GNUC__
141
#pragma GCC diagnostic push
142
#pragma GCC diagnostic ignored "-Woverloaded-virtual"
143
#endif
144
149
virtual
void
syncToLayer
(
QgsMapLayer
*
layer
) { Q_UNUSED(
layer
) }
150
#ifdef __GNUC__
151
#pragma GCC diagnostic pop
152
#endif
153
159
virtual
void
setMapLayerConfigWidgetContext(
const
QgsMapLayerConfigWidgetContext
&context );
160
161
public
slots:
162
167
virtual
void
apply
() = 0;
168
174
virtual
void
focusDefaultWidget
();
175
176
signals:
177
178
#ifndef SIP_RUN
179
187
void
dynamicTemporalControlToggled
(
bool
enabled );
188
#endif
189
190
protected
:
191
QPointer< QgsMapLayer >
mLayer
;
192
QgsMapCanvas
*
mMapCanvas
=
nullptr
;
193
QgsMapLayerConfigWidgetContext
mMapLayerConfigWidgetContext
;
194
};
195
196
#endif
// QGSMAPLAYERCONFIGWIDGET_H
QgsLayerTreeGroup
Layer tree group node serves as a container for layers and further groups.
Definition
qgslayertreegroup.h:45
QgsMapCanvas
Map canvas is a class for displaying all GIS data types on a canvas.
Definition
qgsmapcanvas.h:96
QgsMapLayerConfigWidgetContext
Encapsulates the context for a QgsMapLayerConfigWidget.
Definition
qgsmaplayerconfigwidget.h:37
QgsMapLayerConfigWidgetContext::setAnnotationId
void setAnnotationId(const QString &id)
Sets the item id of the target annotation, when modifying an annotation from a QgsAnnotationLayer.
Definition
qgsmaplayerconfigwidget.h:53
QgsMapLayerConfigWidgetContext::setMessageBar
void setMessageBar(QgsMessageBar *bar)
Sets the message bar associated with the widget.
Definition
qgsmaplayerconfigwidget.h:74
QgsMapLayerConfigWidgetContext::messageBar
QgsMessageBar * messageBar() const
Returns the message bar associated with the widget.
Definition
qgsmaplayerconfigwidget.h:80
QgsMapLayerConfigWidgetContext::mapCanvas
QgsMapCanvas * mapCanvas() const
Returns the map canvas associated with the widget.
Definition
qgsmaplayerconfigwidget.h:67
QgsMapLayerConfigWidgetContext::setMapCanvas
void setMapCanvas(QgsMapCanvas *canvas)
Sets the map canvas associated with the widget.
Definition
qgsmaplayerconfigwidget.h:61
QgsMapLayerConfigWidgetContext::annotationId
QString annotationId() const
Returns the item ID of the target annotation, when modifying an annotation from a QgsAnnotationLayer.
Definition
qgsmaplayerconfigwidget.h:45
QgsMapLayerConfigWidget::QgsMapLayerConfigWidget
QgsMapLayerConfigWidget(QgsMapLayer *layer, QgsMapCanvas *canvas, QWidget *parent=nullptr)
A panel widget that can be shown in the map style dock.
Definition
qgsmaplayerconfigwidget.cpp:40
QgsMapLayerConfigWidget::mLayer
QPointer< QgsMapLayer > mLayer
Definition
qgsmaplayerconfigwidget.h:191
QgsMapLayerConfigWidget::apply
virtual void apply()=0
Called when changes to the layer need to be made.
QgsMapLayerConfigWidget::mMapCanvas
QgsMapCanvas * mMapCanvas
Definition
qgsmaplayerconfigwidget.h:192
QgsMapLayerConfigWidget::dynamicTemporalControlToggled
void dynamicTemporalControlToggled(bool enabled)
Emitted whenever the dynamic temporal control option is toggled in the associated layer properties di...
QgsMapLayerConfigWidget::syncToLayer
virtual void syncToLayer(QgsMapLayer *layer)
Reset to original (vector layer) values.
Definition
qgsmaplayerconfigwidget.h:149
QgsMapLayerConfigWidget::mMapLayerConfigWidgetContext
QgsMapLayerConfigWidgetContext mMapLayerConfigWidgetContext
Definition
qgsmaplayerconfigwidget.h:193
QgsMapLayerConfigWidget::focusDefaultWidget
virtual void focusDefaultWidget()
Focuses the default widget for the page.
Definition
qgsmaplayerconfigwidget.cpp:56
QgsMapLayerConfigWidget::shouldTriggerLayerRepaint
virtual bool shouldTriggerLayerRepaint() const
Whether this config widget changes map layer properties in a way that triggerRepaint() should be call...
Definition
qgsmaplayerconfigwidget.h:138
QgsMapLayerConfigWidget::layer
QgsMapLayer * layer()
Returns the layer the widget is associated with.
Definition
qgsmaplayerconfigwidget.cpp:46
QgsMapLayer
Base class for all map layer types.
Definition
qgsmaplayer.h:83
QgsMessageBar
A bar for displaying non-blocking messages to the user.
Definition
qgsmessagebar.h:61
QgsPanelWidget::QgsPanelWidget
QgsPanelWidget(QWidget *parent=nullptr)
Base class for any widget that can be shown as an inline panel.
Definition
qgspanelwidget.cpp:30
qgslayertreegroup.h
qgspanelwidget.h
Generated on
for QGIS API Documentation by
1.17.0