QGIS API Documentation 3.36.0-Maidenhead (09951dc0acf)
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 showEngineConfigDialog();
79
80 private:
81
82 enum Mode
83 {
84 ModeNone,
85 ModeSingle,
86 ModeRuleBased,
87 ModeBlocking
88 };
89
90 QgsVectorLayer *mLayer = nullptr;
91 QgsMapCanvas *mCanvas = nullptr;
92 QgsMessageBar *mMessageBar = nullptr;
93
94 QWidget *mWidget = nullptr;
95 std::unique_ptr< QgsPalLayerSettings > mSimpleSettings;
96 std::unique_ptr< QgsAbstractVectorLayerLabeling > mOldSettings;
97 bool mOldLabelsEnabled = false;
98};
99
100#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:75
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.