QGIS API Documentation 3.41.0-Master (af5edcb665c)
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:
49 QgsLabelingEngineRuleWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr )
50 : QgsPanelWidget( parent )
51 {}
52
57 virtual void setRule( const QgsAbstractLabelingEngineRule *rule ) = 0;
58
67
68 signals:
69
73 void changed();
74};
75
76#ifndef SIP_RUN
77
88class GUI_EXPORT QgsLabelingEngineRuleDialog : public QDialog
89{
90 Q_OBJECT
91
92 public:
99 QgsLabelingEngineRuleDialog( QgsLabelingEngineRuleWidget *widget, QWidget *parent SIP_TRANSFERTHIS = nullptr, Qt::WindowFlags flags = QgsGuiUtils::ModalDialogFlags );
100
105 void setRule( const QgsAbstractLabelingEngineRule *rule );
106
115
116 private:
117 QgsLabelingEngineRuleWidget *mWidget = nullptr;
118 QDialogButtonBox *mButtonBox = nullptr;
119};
120
121
123class GUI_EXPORT QgsLabelingEngineRuleAvoidLabelOverlapWithFeatureWidget : public QgsLabelingEngineRuleWidget, private Ui_QgsLabelingRuleAvoidLabelOverlapWithFeatureWidgetBase
124{
125 Q_OBJECT
126
127 public:
128 QgsLabelingEngineRuleAvoidLabelOverlapWithFeatureWidget( QWidget *parent = nullptr );
129
130 void setRule( const QgsAbstractLabelingEngineRule *rule ) override;
132
133 private slots:
134
135 void onChanged();
136
137 private:
138 bool mBlockSignals = false;
139};
140
141class GUI_EXPORT QgsLabelingEngineRuleMinimumDistanceLabelToFeatureWidget : public QgsLabelingEngineRuleWidget, private Ui_QgsLabelingRuleMinimumDistanceLabelToFeatureWidgetBase
142{
143 Q_OBJECT
144
145 public:
146 QgsLabelingEngineRuleMinimumDistanceLabelToFeatureWidget( QWidget *parent = nullptr );
147
148 void setRule( const QgsAbstractLabelingEngineRule *rule ) override;
150
151 private slots:
152
153 void onChanged();
154
155 private:
156 bool mBlockSignals = false;
157};
158
159class GUI_EXPORT QgsLabelingEngineRuleMaximumDistanceLabelToFeatureWidget : public QgsLabelingEngineRuleWidget, private Ui_QgsLabelingRuleMaximumDistanceLabelToFeatureWidgetBase
160{
161 Q_OBJECT
162
163 public:
164 QgsLabelingEngineRuleMaximumDistanceLabelToFeatureWidget( QWidget *parent = nullptr );
165
166 void setRule( const QgsAbstractLabelingEngineRule *rule ) override;
168
169 private slots:
170
171 void onChanged();
172
173 private:
174 bool mBlockSignals = false;
175};
176
177class GUI_EXPORT QgsLabelingEngineRuleMinimumDistanceLabelToLabelWidget : public QgsLabelingEngineRuleWidget, private Ui_QgsLabelingRuleMinimumDistanceLabelToLabelWidgetBase
178{
179 Q_OBJECT
180
181 public:
182 QgsLabelingEngineRuleMinimumDistanceLabelToLabelWidget( QWidget *parent = nullptr );
183
184 void setRule( const QgsAbstractLabelingEngineRule *rule ) override;
186
187 private slots:
188
189 void onChanged();
190
191 private:
192 bool mBlockSignals = false;
193};
194
196
197
198#endif
199
200
201#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