QGIS API Documentation 3.39.0-Master (d85f3c2a281)
Loading...
Searching...
No Matches
qgslabelingenginerulewidget.h
Go to the documentation of this file.
1/***************************************************************************
2 qgslabelingenginerulewidget.h
3 ------------------------
4 begin : September 2024
5 copyright : (C) 2024 by Nyall Dawson
6 email : nyall dot dawson 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 QGSLABELINGENGINERULEWIDGET_H
16#define QGSLABELINGENGINERULEWIDGET_H
17
18#include "qgis_sip.h"
19#include "qgspanelwidget.h"
20#include "qgsguiutils.h"
21#include "ui_qgslabelingruleavoidoverlapwidgetbase.h"
22#include "ui_qgslabelingrulemindistancelabeltofeaturewidgetbase.h"
23#include "ui_qgslabelingrulemaxdistancelabeltofeaturewidgetbase.h"
24#include "ui_qgslabelingrulemindistancelabeltolabelwidgetbase.h"
25
26#include <QDialog>
27
29class QDialogButtonBox;
30
42{
43 Q_OBJECT
44
45 public:
46
50 QgsLabelingEngineRuleWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr )
51 : QgsPanelWidget( parent )
52 {}
53
58 virtual void setRule( const QgsAbstractLabelingEngineRule *rule ) = 0;
59
68
69 signals:
70
74 void changed();
75
76};
77
78#ifndef SIP_RUN
79
90class GUI_EXPORT QgsLabelingEngineRuleDialog : public QDialog
91{
92 Q_OBJECT
93
94 public:
95
103 QWidget *parent SIP_TRANSFERTHIS = nullptr, Qt::WindowFlags flags = QgsGuiUtils::ModalDialogFlags );
104
109 void setRule( const QgsAbstractLabelingEngineRule *rule );
110
119
120 private:
121
122 QgsLabelingEngineRuleWidget *mWidget = nullptr;
123 QDialogButtonBox *mButtonBox = nullptr;
124
125};
126
127
129class GUI_EXPORT QgsLabelingEngineRuleAvoidLabelOverlapWithFeatureWidget : public QgsLabelingEngineRuleWidget, private Ui_QgsLabelingRuleAvoidLabelOverlapWithFeatureWidgetBase
130{
131 Q_OBJECT
132
133 public:
134 QgsLabelingEngineRuleAvoidLabelOverlapWithFeatureWidget( QWidget *parent = nullptr );
135
136 void setRule( const QgsAbstractLabelingEngineRule *rule ) override;
138
139 private slots:
140
141 void onChanged();
142
143 private:
144
145 bool mBlockSignals = false;
146};
147
148class GUI_EXPORT QgsLabelingEngineRuleMinimumDistanceLabelToFeatureWidget : public QgsLabelingEngineRuleWidget, private Ui_QgsLabelingRuleMinimumDistanceLabelToFeatureWidgetBase
149{
150 Q_OBJECT
151
152 public:
153 QgsLabelingEngineRuleMinimumDistanceLabelToFeatureWidget( QWidget *parent = nullptr );
154
155 void setRule( const QgsAbstractLabelingEngineRule *rule ) override;
157
158 private slots:
159
160 void onChanged();
161
162 private:
163
164 bool mBlockSignals = false;
165};
166
167class GUI_EXPORT QgsLabelingEngineRuleMaximumDistanceLabelToFeatureWidget : public QgsLabelingEngineRuleWidget, private Ui_QgsLabelingRuleMaximumDistanceLabelToFeatureWidgetBase
168{
169 Q_OBJECT
170
171 public:
172 QgsLabelingEngineRuleMaximumDistanceLabelToFeatureWidget( QWidget *parent = nullptr );
173
174 void setRule( const QgsAbstractLabelingEngineRule *rule ) override;
176
177 private slots:
178
179 void onChanged();
180
181 private:
182
183 bool mBlockSignals = false;
184};
185
186class GUI_EXPORT QgsLabelingEngineRuleMinimumDistanceLabelToLabelWidget : public QgsLabelingEngineRuleWidget, private Ui_QgsLabelingRuleMinimumDistanceLabelToLabelWidgetBase
187{
188 Q_OBJECT
189
190 public:
191 QgsLabelingEngineRuleMinimumDistanceLabelToLabelWidget( QWidget *parent = nullptr );
192
193 void setRule( const QgsAbstractLabelingEngineRule *rule ) override;
195
196 private slots:
197
198 void onChanged();
199
200 private:
201
202 bool mBlockSignals = false;
203};
204
206
207
208#endif
209
210
211#endif // QGSLABELINGENGINERULEWIDGET_H
Abstract base class for labeling engine rules.
A simple dialog for customizing a labeling engine rule.
Base class for widgets which allow control over the properties of QgsAbstractLabelingEngineRule subcl...
QgsLabelingEngineRuleWidget(QWidget *parent=nullptr)
Constructor for QgsLabelingEngineRuleWidget.
virtual void setRule(const QgsAbstractLabelingEngineRule *rule)=0
Sets the rule to show in the widget.
virtual QgsAbstractLabelingEngineRule * rule()=0
Returns the rule defined by the current settings in the widget.
void changed()
Emitted whenever the configuration of the rule is changed.
Base class for any widget that can be shown as a inline panel.
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53
#define SIP_TRANSFERBACK
Definition qgis_sip.h:48