QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
qgslabelremoveduplicatesettingswidget.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgslabelremoveduplicatessettingswidget.h
3 ----------------------
4 begin : December 2019
5 copyright : (C) 2019 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
16
18
20
21#include "moc_qgslabelremoveduplicatesettingswidget.cpp"
22
24 : QgsLabelSettingsWidgetBase( parent, layer )
25{
26 setupUi( this );
27
28 setPanelTitle( tr( "Duplicate Removal" ) );
29
31
32 connect( mNoRepeatDistSpinBox, qOverload<double>( &QDoubleSpinBox::valueChanged ), this, [this]( double ) {
33 if ( !mBlockSignals )
34 emit changed();
35 } );
36 connect( mNoRepeatDistUnitWidget, &QgsUnitSelectionWidget::changed, this, [this] {
37 if ( !mBlockSignals )
38 emit changed();
39 } );
40
42}
43
45{
46 mSettings = settings;
47 mBlockSignals = true;
48
49 mNoRepeatDistSpinBox->setValue( mSettings.minimumDistanceToDuplicate() );
50 mNoRepeatDistUnitWidget->setUnit( mSettings.minimumDistanceToDuplicateUnit() );
51 mNoRepeatDistUnitWidget->setMapUnitScale( mSettings.minimumDistanceToDuplicateMapUnitScale() );
52
53 mBlockSignals = false;
54}
55
57{
58 mSettings.setMinimumDistanceToDuplicate( mNoRepeatDistSpinBox->value() );
59 mSettings.setMinimumDistanceToDuplicateUnit( mNoRepeatDistUnitWidget->unit() );
60 mSettings.setMinimumDistanceToDuplicateMapUnitScale( mNoRepeatDistUnitWidget->getMapUnitScale() );
61 return mSettings;
62}
63
67
GeometryType
The geometry types are used to group Qgis::WkbType in a coarse way.
Definition qgis.h:358
@ Millimeters
Millimeters.
Definition qgis.h:5184
@ Points
Points (e.g., for font sizes).
Definition qgis.h:5188
@ MapUnits
Map units.
Definition qgis.h:5185
@ Pixels
Pixels.
Definition qgis.h:5186
@ Inches
Inches.
Definition qgis.h:5189
@ MetersInMapUnits
Meters value as Map units.
Definition qgis.h:5191
void setSettings(const QgsLabelThinningSettings &settings)
Sets the thinning settings to show in the widget.
QgsLabelRemoveDuplicatesSettingsWidget(QWidget *parent=nullptr, QgsMapLayer *layer=nullptr)
Constructor for QgsLabelRemoveDuplicatesSettingsWidget.
QgsLabelThinningSettings settings() const
Returns the thinning settings defined by the widget.
void updateDataDefinedProperties(QgsPropertyCollection &properties) override
Updates a data defined properties collection, correctly setting the values for any properties related...
void setGeometryType(Qgis::GeometryType type) override
Sets the geometry type of the features to customize the widget accordingly.
QgsLabelSettingsWidgetBase(QWidget *parent=nullptr, QgsMapLayer *vl=nullptr)
Constructor for QgsLabelSettingsWidgetBase.
void changed()
Emitted when any of the settings described by the widget are changed.
void registerDataDefinedButton(QgsPropertyOverrideButton *button, QgsPalLayerSettings::Property key)
Registers a data defined override button.
QgsPropertyCollection mDataDefinedProperties
Contains the data defined properties defined by the widget.
Contains settings related to how the label engine removes candidate label positions and reduces the n...
void setMinimumDistanceToDuplicate(double distance)
Sets the minimum distance to labels with duplicate text.
Base class for all map layer types.
Definition qgsmaplayer.h:80
@ RemoveDuplicateLabelDistance
Minimum distance from labels for this feature to other labels with duplicate text.
void setPanelTitle(const QString &panelTitle)
Set the title of the panel when shown in the interface.
A grouped map of multiple QgsProperty objects, each referenced by an integer key value.
void setProperty(int key, const QgsProperty &property)
Adds a property to the collection and takes ownership of it.
void changed()
Emitted when the selected unit is changed, or the definition of the map unit scale is changed.
QList< Qgis::RenderUnit > RenderUnitList
List of render units.