17#include "moc_qgssymbolbuffersettingswidget.cpp"
22#include <QDialogButtonBox>
31 mSpinWidth->setClearValue( 1 );
32 mSpinWidth->setShowClearButton(
true );
33 mSpinWidth->setValue( 1 );
35 mEnabledGroup->setChecked(
false );
41 mFillSymbolButton->setDialogTitle( tr(
"Fill Symbol" ) );
43 mFillSymbolButton->setToDefaultSymbol();
45 mComboJoinStyle->setPenJoinStyle( Qt::RoundJoin );
47 connect( mEnabledGroup, &QGroupBox::toggled,
this, &QgsSymbolBufferSettingsWidget::onWidgetChanged );
48 connect( mSpinWidth, qOverload<double>( &QgsDoubleSpinBox::valueChanged ),
this, &QgsSymbolBufferSettingsWidget::onWidgetChanged );
49 connect( mComboJoinStyle, qOverload<int>( &QComboBox::currentIndexChanged ),
this, &QgsSymbolBufferSettingsWidget::onWidgetChanged );
57 mEnabledGroup->setChecked( settings.
enabled() );
58 mSpinWidth->setValue( settings.
size() );
59 mSizeUnitWidget->setUnit( settings.
sizeUnit() );
61 mComboJoinStyle->setPenJoinStyle( settings.
joinStyle() );
64 mFillSymbolButton->setSymbol( fill->clone() );
65 mBlockUpdates =
false;
71 settings.
setEnabled( mEnabledGroup->isChecked() );
72 settings.
setSize( mSpinWidth->value() );
75 settings.
setJoinStyle( mComboJoinStyle->penJoinStyle() );
80void QgsSymbolBufferSettingsWidget::onWidgetChanged()
92 : QDialog( parent, f )
94 QVBoxLayout *vLayout =
new QVBoxLayout();
96 vLayout->addWidget( mWidget );
97 QDialogButtonBox *bbox =
new QDialogButtonBox( QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal );
98 connect( bbox, &QDialogButtonBox::accepted,
this, &QgsSymbolBufferSettingsDialog::accept );
99 connect( bbox, &QDialogButtonBox::rejected,
this, &QgsSymbolBufferSettingsDialog::reject );
100 vLayout->addWidget( bbox );
101 setLayout( vLayout );
102 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