17#include "moc_qgssymbolbuffersettingswidget.cpp"
22#include <QDialogButtonBox>
31 mSpinWidth->setClearValue( 1 );
32 mSpinWidth->setShowClearButton(
true );
33 mSpinWidth->setValue( 1 );
35 mEnabledGroup->setChecked(
false );
47 mFillSymbolButton->setDialogTitle( tr(
"Fill Symbol" ) );
49 mFillSymbolButton->setToDefaultSymbol();
51 mComboJoinStyle->setPenJoinStyle( Qt::RoundJoin );
53 connect( mEnabledGroup, &QGroupBox::toggled,
this, &QgsSymbolBufferSettingsWidget::onWidgetChanged );
54 connect( mSpinWidth, qOverload< double >( &QgsDoubleSpinBox::valueChanged ),
this, &QgsSymbolBufferSettingsWidget::onWidgetChanged );
55 connect( mComboJoinStyle, qOverload< int >( &QComboBox::currentIndexChanged ),
this, &QgsSymbolBufferSettingsWidget::onWidgetChanged );
63 mEnabledGroup->setChecked( settings.
enabled() );
64 mSpinWidth->setValue( settings.
size() );
65 mSizeUnitWidget->setUnit( settings.
sizeUnit() );
67 mComboJoinStyle->setPenJoinStyle( settings.
joinStyle() );
70 mFillSymbolButton->setSymbol( fill->clone() );
71 mBlockUpdates =
false;
77 settings.
setEnabled( mEnabledGroup->isChecked() );
78 settings.
setSize( mSpinWidth->value() );
81 settings.
setJoinStyle( mComboJoinStyle->penJoinStyle() );
86void QgsSymbolBufferSettingsWidget::onWidgetChanged()
98 : QDialog( parent, f )
100 QVBoxLayout *vLayout =
new QVBoxLayout();
102 vLayout->addWidget( mWidget );
103 QDialogButtonBox *bbox =
new QDialogButtonBox( QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal );
104 connect( bbox, &QDialogButtonBox::accepted,
this, &QgsSymbolBufferSettingsDialog::accept );
105 connect( bbox, &QDialogButtonBox::rejected,
this, &QgsSymbolBufferSettingsDialog::reject );
106 vLayout->addWidget( bbox );
107 setLayout( vLayout );
108 setWindowTitle( tr(
"Buffer Settings" ) );
@ Millimeters
Millimeters.
@ Points
Points (e.g., for font sizes)
@ MetersInMapUnits
Meters value as Map units.
A fill symbol type, for rendering Polygon and MultiPolygon geometries.
Renders polygons using a single fill and stroke color.
QgsSymbolBufferSettingsDialog(QWidget *parent=nullptr, Qt::WindowFlags f=Qt::WindowFlags())
Constructor for QgsSymbolBufferSettingsDialog.
QgsSymbolBufferSettings bufferSettings() const
Returns the buffer settings as defined in the dialog.
void setBufferSettings(const QgsSymbolBufferSettings &settings)
Sets the buffer settings to show in the dialog.
Contains settings relating to symbol buffers, which draw a "halo" effect around the symbol.
QgsFillSymbol * fillSymbol() const
Returns the fill symbol used to render the buffer.
void setEnabled(bool enabled)
Sets whether the symbol buffer will be drawn.
void setSizeMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale object for the buffer size.
bool enabled() const
Returns whether the buffer is enabled.
QgsMapUnitScale sizeMapUnitScale() const
Returns the map unit scale object for the buffer size.
void setSize(double size)
Sets the size of the buffer.
void setJoinStyle(Qt::PenJoinStyle style)
Sets the join style used for drawing the buffer.
void setFillSymbol(QgsFillSymbol *symbol)
Sets the fill symbol used to render the buffer.
void setSizeUnit(Qgis::RenderUnit unit)
Sets the unit used for the buffer size.
Qt::PenJoinStyle joinStyle() const
Returns the buffer join style.
Qgis::RenderUnit sizeUnit() const
Returns the units for the buffer size.
double size() const
Returns the size of the buffer.
QList< QgsSymbolLayer * > QgsSymbolLayerList