QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
gui
labeling
qgslabelingwidget.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgslabelingwidget.h
3
---------------------
4
begin : September 2015
5
copyright : (C) 2015 by Martin Dobias
6
email : wonder dot sk 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 QGSLABELINGWIDGET_H
16
#define QGSLABELINGWIDGET_H
17
18
// We don't want to expose this in the public API
19
20
#include "ui_qgslabelingwidget.h"
21
22
#include "qgis_gui.h"
23
#include "
qgsmaplayerconfigwidget.h
"
24
#include "
qgspallabeling.h
"
25
#include "
qgsvectorlayerlabeling.h
"
26
27
#include <QWidget>
28
29
#define SIP_NO_FILE
30
31
class
QgsLabelingGui;
32
class
QgsMapCanvas
;
33
class
QgsRuleBasedLabelingWidget
;
34
class
QgsVectorLayer
;
35
class
QgsMapLayer
;
36
class
QgsMessageBar
;
37
45
class
GUI_EXPORT
QgsLabelingWidget
:
public
QgsMapLayerConfigWidget
,
private
Ui::QgsLabelingWidget
46
{
47
Q_OBJECT
48
public
:
50
QgsLabelingWidget
(
QgsVectorLayer
*
layer
,
QgsMapCanvas
*canvas, QWidget *parent =
nullptr
,
QgsMessageBar
*messageBar =
nullptr
);
51
56
QgsLabelingGui *
labelingGui
();
57
65
static
void
showLabelingEngineRules
( QWidget *parent,
QgsMapCanvas
*canvas );
66
74
static
void
showEngineConfiguration
( QWidget *parent,
QgsMapCanvas
*canvas );
75
76
public
slots:
78
void
setLayer
(
QgsMapLayer
*
layer
);
80
void
writeSettingsToLayer
();
81
83
void
apply
()
override
;
84
86
void
adaptToLayer
();
87
89
void
resetSettings
();
90
91
signals:
93
void
auxiliaryFieldCreated
();
94
95
private
slots:
96
void
labelModeChanged(
int
index );
97
void
showLabelingEngineRulesPrivate();
98
void
showEngineConfigDialogPrivate();
99
100
private
:
101
enum
Mode
102
{
103
ModeNone,
104
ModeSingle,
105
ModeRuleBased,
106
ModeBlocking
107
};
108
109
QgsVectorLayer
*mLayer =
nullptr
;
110
QgsMapCanvas
*mCanvas =
nullptr
;
111
QgsMessageBar
*mMessageBar =
nullptr
;
112
113
QWidget *mWidget =
nullptr
;
114
std::unique_ptr<QgsPalLayerSettings> mSimpleSettings;
115
std::unique_ptr<QgsAbstractVectorLayerLabeling> mOldSettings;
116
bool
mOldLabelsEnabled =
false
;
117
};
118
119
#endif
// QGSLABELINGWIDGET_H
QgsLabelingWidget::adaptToLayer
void adaptToLayer()
reload the settings shown in the dialog from the current layer
Definition
qgslabelingwidget.cpp:105
QgsLabelingWidget::labelingGui
QgsLabelingGui * labelingGui()
Returns the labeling gui widget or nullptr if none.
Definition
qgslabelingwidget.cpp:64
QgsLabelingWidget::showLabelingEngineRules
static void showLabelingEngineRules(QWidget *parent, QgsMapCanvas *canvas)
Shows the labeling engine rules.
Definition
qgslabelingwidget.cpp:295
QgsLabelingWidget::QgsLabelingWidget
QgsLabelingWidget(QgsVectorLayer *layer, QgsMapCanvas *canvas, QWidget *parent=nullptr, QgsMessageBar *messageBar=nullptr)
constructor
Definition
qgslabelingwidget.cpp:39
QgsLabelingWidget::auxiliaryFieldCreated
void auxiliaryFieldCreated()
Emitted when an auxiliary field is created.
QgsLabelingWidget::writeSettingsToLayer
void writeSettingsToLayer()
save config to layer
Definition
qgslabelingwidget.cpp:134
QgsLabelingWidget::resetSettings
void resetSettings()
Reset the settings.
Definition
qgslabelingwidget.cpp:69
QgsLabelingWidget::setLayer
void setLayer(QgsMapLayer *layer)
Sets the layer to configure.
Definition
qgslabelingwidget.cpp:80
QgsLabelingWidget::showEngineConfiguration
static void showEngineConfiguration(QWidget *parent, QgsMapCanvas *canvas)
Shows the labeling engine configuration.
Definition
qgslabelingwidget.cpp:341
QgsMapCanvas
Map canvas is a class for displaying all GIS data types on a canvas.
Definition
qgsmapcanvas.h:96
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::apply
virtual void apply()=0
Called when changes to the layer need to be made.
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
QgsRuleBasedLabelingWidget
Widget for configuring rule based labeling.
Definition
qgsrulebasedlabelingwidget.h:109
QgsVectorLayer
Represents a vector layer which manages a vector based dataset.
Definition
qgsvectorlayer.h:414
qgsmaplayerconfigwidget.h
qgspallabeling.h
qgsvectorlayerlabeling.h
Generated on
for QGIS API Documentation by
1.17.0