30 connect( mObstacleTypeComboBox, qgis::overload<int>::of( &QComboBox::currentIndexChanged ),
this, [ = ](
int )
35 connect( mObstacleFactorSlider, &QSlider::valueChanged,
this, [ = ]
48 mObstacleFactorSlider->setValue( static_cast< int >( std::round( settings.
factor() * 5 ) ) );
49 mObstacleTypeComboBox->setCurrentIndex( mObstacleTypeComboBox->findData( settings.
type() ) );
50 mBlockSignals =
false;
56 settings.
setFactor( mObstacleFactorSlider->value() / 5.0 );
57 settings.
setType( static_cast< QgsLabelObstacleSettings::ObstacleType >( mObstacleTypeComboBox->currentData().toInt() ) );
void setProperty(int key, const QgsProperty &property)
Adds a property to the collection and takes ownership of it.
void setFactor(double factor)
Sets the obstacle factor, where 1.0 = default, < 1.0 more likely to be covered by labels...
Contains settings related to how the label engine treats features as obstacles.
GeometryType
The geometry types are used to group QgsWkbTypes::Type in a coarse way.
A grouped map of multiple QgsProperty objects, each referenced by a integer key value.
double factor() const
Returns the obstacle factor, where 1.0 = default, < 1.0 more likely to be covered by labels...
ObstacleType type() const
Returns how features act as obstacles for labels.
Represents a vector layer which manages a vector based data sets.
void setType(ObstacleType type)
Controls how features act as obstacles for labels.
QgsProperty property(int key) const override
Returns a matching property from the collection, if one exists.