QGIS API Documentation 3.39.0-Master (bca3cdb6021)
Loading...
Searching...
No Matches
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#define SIP_NO_FILE
20
21#include <QWidget>
22
23#include "ui_qgslabelingwidget.h"
24#include "qgspallabeling.h"
26#include "qgis_gui.h"
27
29
30class QgsLabelingGui;
31class QgsMapCanvas;
33class QgsVectorLayer;
34class QgsMapLayer;
35class QgsMessageBar;
36
44class GUI_EXPORT QgsLabelingWidget : public QgsMapLayerConfigWidget, private Ui::QgsLabelingWidget
45{
46 Q_OBJECT
47 public:
49 QgsLabelingWidget( QgsVectorLayer *layer, QgsMapCanvas *canvas, QWidget *parent = nullptr, QgsMessageBar *messageBar = nullptr );
50
55 QgsLabelingGui *labelingGui();
56
57 public slots:
59 void setLayer( QgsMapLayer *layer );
61 void writeSettingsToLayer();
62
64 void apply() override;
65
67 void adaptToLayer();
68
70 void resetSettings();
71
72 signals:
75
76 private slots:
77 void labelModeChanged( int index );
78 void showLabelingEngineRules();
79 void showEngineConfigDialog();
80
81 private:
82
83 enum Mode
84 {
85 ModeNone,
86 ModeSingle,
87 ModeRuleBased,
88 ModeBlocking
89 };
90
91 QgsVectorLayer *mLayer = nullptr;
92 QgsMapCanvas *mCanvas = nullptr;
93 QgsMessageBar *mMessageBar = nullptr;
94
95 QWidget *mWidget = nullptr;
96 std::unique_ptr< QgsPalLayerSettings > mSimpleSettings;
97 std::unique_ptr< QgsAbstractVectorLayerLabeling > mOldSettings;
98 bool mOldLabelsEnabled = false;
99};
100
101#endif // QGSLABELINGWIDGET_H
Master widget for configuration of labeling of a vector layer.
void auxiliaryFieldCreated()
Emitted when an auxiliary field is created.
Map canvas is a class for displaying all GIS data types on a canvas.
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.
Base class for all map layer types.
Definition qgsmaplayer.h:76
A bar for displaying non-blocking messages to the user.
Widget for configuring rule based labeling.
Represents a vector layer which manages a vector based data sets.