QGIS API Documentation 4.3.0-Master (b46232e4f9a)
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
70#ifndef SIP_RUN
71
82class GUI_EXPORT QgsLabelingEngineRuleDialog : public QDialog
83{
84 Q_OBJECT
85
86 public:
93 QgsLabelingEngineRuleDialog( QgsLabelingEngineRuleWidget *widget, QWidget *parent SIP_TRANSFERTHIS = nullptr, Qt::WindowFlags flags = QgsGuiUtils::ModalDialogFlags );
94
100
109
110 private:
111 QgsLabelingEngineRuleWidget *mWidget = nullptr;
112 QDialogButtonBox *mButtonBox = nullptr;
113};
114
115
117class GUI_EXPORT QgsLabelingEngineRuleAvoidLabelOverlapWithFeatureWidget : public QgsLabelingEngineRuleWidget, private Ui_QgsLabelingRuleAvoidLabelOverlapWithFeatureWidgetBase
118{
119 Q_OBJECT
120
121 public:
122 QgsLabelingEngineRuleAvoidLabelOverlapWithFeatureWidget( QWidget *parent = nullptr );
123
124 void setRule( const QgsAbstractLabelingEngineRule *rule ) override;
126
127 private slots:
128
129 void onChanged();
130
131 private:
132 bool mBlockSignals = false;
133};
134
135class GUI_EXPORT QgsLabelingEngineRuleMinimumDistanceLabelToFeatureWidget : public QgsLabelingEngineRuleWidget, private Ui_QgsLabelingRuleMinimumDistanceLabelToFeatureWidgetBase
136{
137 Q_OBJECT
138
139 public:
140 QgsLabelingEngineRuleMinimumDistanceLabelToFeatureWidget( QWidget *parent = nullptr );
141
142 void setRule( const QgsAbstractLabelingEngineRule *rule ) override;
144
145 private slots:
146
147 void onChanged();
148
149 private:
150 bool mBlockSignals = false;
151};
152
153class GUI_EXPORT QgsLabelingEngineRuleMaximumDistanceLabelToFeatureWidget : public QgsLabelingEngineRuleWidget, private Ui_QgsLabelingRuleMaximumDistanceLabelToFeatureWidgetBase
154{
155 Q_OBJECT
156
157 public:
158 QgsLabelingEngineRuleMaximumDistanceLabelToFeatureWidget( QWidget *parent = nullptr );
159
160 void setRule( const QgsAbstractLabelingEngineRule *rule ) override;
162
163 private slots:
164
165 void onChanged();
166
167 private:
168 bool mBlockSignals = false;
169};
170
171class GUI_EXPORT QgsLabelingEngineRuleMinimumDistanceLabelToLabelWidget : public QgsLabelingEngineRuleWidget, private Ui_QgsLabelingRuleMinimumDistanceLabelToLabelWidgetBase
172{
173 Q_OBJECT
174
175 public:
176 QgsLabelingEngineRuleMinimumDistanceLabelToLabelWidget( QWidget *parent = nullptr );
177
178 void setRule( const QgsAbstractLabelingEngineRule *rule ) override;
180
181 private slots:
182
183 void onChanged();
184
185 private:
186 bool mBlockSignals = false;
187};
188
190
191
192#endif
193
194
195#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.
QgsPanelWidget(QWidget *parent=nullptr)
Base class for any widget that can be shown as an inline panel.
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:52
#define SIP_TRANSFERBACK
Definition qgis_sip.h:47