QGIS API Documentation 3.99.0-Master (2fe06baccd8)
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 "ui_qgslabelingruleavoidoverlapwidgetbase.h"
19#include "ui_qgslabelingrulemaxdistancelabeltofeaturewidgetbase.h"
20#include "ui_qgslabelingrulemindistancelabeltofeaturewidgetbase.h"
21#include "ui_qgslabelingrulemindistancelabeltolabelwidgetbase.h"
22
23#include "qgis_sip.h"
24#include "qgsguiutils.h"
25#include "qgspanelwidget.h"
26
27#include <QDialog>
28
30class QDialogButtonBox;
31
43{
44 Q_OBJECT
45
46 public:
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#ifndef SIP_RUN
78
89class GUI_EXPORT QgsLabelingEngineRuleDialog : public QDialog
90{
91 Q_OBJECT
92
93 public:
100 QgsLabelingEngineRuleDialog( QgsLabelingEngineRuleWidget *widget, QWidget *parent SIP_TRANSFERTHIS = nullptr, Qt::WindowFlags flags = QgsGuiUtils::ModalDialogFlags );
101
107
116
117 private:
118 QgsLabelingEngineRuleWidget *mWidget = nullptr;
119 QDialogButtonBox *mButtonBox = nullptr;
120};
121
122
124class GUI_EXPORT QgsLabelingEngineRuleAvoidLabelOverlapWithFeatureWidget : public QgsLabelingEngineRuleWidget, private Ui_QgsLabelingRuleAvoidLabelOverlapWithFeatureWidgetBase
125{
126 Q_OBJECT
127
128 public:
129 QgsLabelingEngineRuleAvoidLabelOverlapWithFeatureWidget( QWidget *parent = nullptr );
130
131 void setRule( const QgsAbstractLabelingEngineRule *rule ) override;
133
134 private slots:
135
136 void onChanged();
137
138 private:
139 bool mBlockSignals = false;
140};
141
142class GUI_EXPORT QgsLabelingEngineRuleMinimumDistanceLabelToFeatureWidget : public QgsLabelingEngineRuleWidget, private Ui_QgsLabelingRuleMinimumDistanceLabelToFeatureWidgetBase
143{
144 Q_OBJECT
145
146 public:
147 QgsLabelingEngineRuleMinimumDistanceLabelToFeatureWidget( QWidget *parent = nullptr );
148
149 void setRule( const QgsAbstractLabelingEngineRule *rule ) override;
151
152 private slots:
153
154 void onChanged();
155
156 private:
157 bool mBlockSignals = false;
158};
159
160class GUI_EXPORT QgsLabelingEngineRuleMaximumDistanceLabelToFeatureWidget : public QgsLabelingEngineRuleWidget, private Ui_QgsLabelingRuleMaximumDistanceLabelToFeatureWidgetBase
161{
162 Q_OBJECT
163
164 public:
165 QgsLabelingEngineRuleMaximumDistanceLabelToFeatureWidget( QWidget *parent = nullptr );
166
167 void setRule( const QgsAbstractLabelingEngineRule *rule ) override;
169
170 private slots:
171
172 void onChanged();
173
174 private:
175 bool mBlockSignals = false;
176};
177
178class GUI_EXPORT QgsLabelingEngineRuleMinimumDistanceLabelToLabelWidget : public QgsLabelingEngineRuleWidget, private Ui_QgsLabelingRuleMinimumDistanceLabelToLabelWidgetBase
179{
180 Q_OBJECT
181
182 public:
183 QgsLabelingEngineRuleMinimumDistanceLabelToLabelWidget( QWidget *parent = nullptr );
184
185 void setRule( const QgsAbstractLabelingEngineRule *rule ) override;
187
188 private slots:
189
190 void onChanged();
191
192 private:
193 bool mBlockSignals = false;
194};
195
197
198
199#endif
200
201
202#endif // QGSLABELINGENGINERULEWIDGET_H
Abstract base class for labeling engine rules.
void setRule(const QgsAbstractLabelingEngineRule *rule)
Sets the rule to show in the dialog.
QgsAbstractLabelingEngineRule * rule()
Returns the rule defined by the current settings in the dialog.
QgsLabelingEngineRuleDialog(QgsLabelingEngineRuleWidget *widget, QWidget *parent=nullptr, Qt::WindowFlags flags=QgsGuiUtils::ModalDialogFlags)
Constructor for QgsLabelingEngineRuleDialog.
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.
QgsPanelWidget(QWidget *parent=nullptr)
Base class for any widget that can be shown as an inline panel.
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53
#define SIP_TRANSFERBACK
Definition qgis_sip.h:48