QGIS API Documentation 3.41.0-Master (af5edcb665c)
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 enum Mode
81 {
82 ModeNone,
83 ModeVertices,
84 ModeFaces
85 };
86
87 QgsMeshLayer *mLayer = nullptr;
88 QgsMapCanvas *mCanvas = nullptr;
89 QgsMessageBar *mMessageBar = nullptr;
90
91 QWidget *mWidget = nullptr;
92 std::unique_ptr<QgsPalLayerSettings> mSettings;
93 std::unique_ptr<QgsAbstractMeshLayerLabeling> mOldSettings;
94 bool mOldLabelsEnabled = false;
95};
96
97#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.