QGIS API Documentation 3.99.0-Master (a5475b57e34)
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
20#include "ui_qgsmeshlabelingwidget.h"
21
22#include "qgis_gui.h"
25#include "qgspallabeling.h"
26
27#include <QWidget>
28
29#define SIP_NO_FILE
30
31class QgsLabelingGui;
32class QgsMapCanvas;
33class QgsMeshLayer;
34class QgsMapLayer;
35class QgsMessageBar;
36
44class GUI_EXPORT QgsMeshLabelingWidget : public QgsMapLayerConfigWidget, private Ui::QgsMeshLabelingWidget
45{
46 Q_OBJECT
47 public:
49 QgsMeshLabelingWidget( QgsMeshLayer *layer, QgsMapCanvas *canvas, QWidget *parent = nullptr, QgsMessageBar *messageBar = nullptr );
50
51 void setDockMode( bool dockMode ) override;
52
56 QgsLabelingGui *labelingGui();
57
58 public slots:
60 void setLayer( QgsMapLayer *layer );
63
65 void apply() override;
66
68 void adaptToLayer();
69
71 void resetSettings();
72
73 signals:
76
77 private slots:
78 void labelModeChanged( int index );
79
80 private:
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.
QgsMapLayerConfigWidget(QgsMapLayer *layer, QgsMapCanvas *canvas, QWidget *parent=nullptr)
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:83
void writeSettingsToLayer()
save config to layer
QgsLabelingGui * labelingGui()
Returns the labeling gui widget or nullptr if none.
void auxiliaryFieldCreated()
Emitted when an auxiliary field is created.
void setLayer(QgsMapLayer *layer)
Sets the layer to configure.
QgsMeshLabelingWidget(QgsMeshLayer *layer, QgsMapCanvas *canvas, QWidget *parent=nullptr, QgsMessageBar *messageBar=nullptr)
constructor
void resetSettings()
Reset the settings.
void adaptToLayer()
reload the settings shown in the dialog from the current layer
Represents a mesh layer supporting display of data on structured or unstructured meshes.
A bar for displaying non-blocking messages to the user.
bool dockMode() const
Returns the dock mode state.
virtual void setDockMode(bool dockMode)
Set the widget in dock mode which tells the widget to emit panel widgets and not open dialogs.