QGIS API Documentation 3.41.0-Master (45a0abf3bec)
Loading...
Searching...
No Matches
qgsmeshlabelingwidget.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsmeshlabelingwidget.h
3 ---------------------
4 begin : November 2023
5 copyright : (C) 2023 by Alexander Bruy
6 email : alexander dot bruy 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 QGSMESHLABELINGWIDGET_H
16#define QGSMESHLABELINGWIDGET_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_qgsmeshlabelingwidget.h"
24#include "qgspallabeling.h"
26#include "qgis_gui.h"
27
29
30class QgsLabelingGui;
31class QgsMapCanvas;
32class QgsMeshLayer;
33class QgsMapLayer;
34class QgsMessageBar;
35
43class GUI_EXPORT QgsMeshLabelingWidget : public QgsMapLayerConfigWidget, private Ui::QgsMeshLabelingWidget
44{
45 Q_OBJECT
46 public:
48 QgsMeshLabelingWidget( QgsMeshLayer *layer, QgsMapCanvas *canvas, QWidget *parent = nullptr, QgsMessageBar *messageBar = nullptr );
49
50 void setDockMode( bool dockMode ) override;
51
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
79 private:
80
81 enum Mode
82 {
83 ModeNone,
84 ModeVertices,
85 ModeFaces
86 };
87
88 QgsMeshLayer *mLayer = nullptr;
89 QgsMapCanvas *mCanvas = nullptr;
90 QgsMessageBar *mMessageBar = nullptr;
91
92 QWidget *mWidget = nullptr;
93 std::unique_ptr< QgsPalLayerSettings > mSettings;
94 std::unique_ptr< QgsAbstractMeshLayerLabeling > mOldSettings;
95 bool mOldLabelsEnabled = false;
96};
97
98#endif // QGSMESHLABELINGWIDGET_H
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
Master widget for configuration of labeling of a mesh layer.
void auxiliaryFieldCreated()
Emitted when an auxiliary field is created.
Represents a mesh layer supporting display of data on structured or unstructured meshes.
A bar for displaying non-blocking messages to the user.
virtual void setDockMode(bool dockMode)
Set the widget in dock mode which tells the widget to emit panel widgets and not open dialogs.