21#include <QDialogButtonBox>
30 mSpinWidth->setClearValue( 1 );
31 mSpinWidth->setShowClearButton(
true );
32 mSpinWidth->setValue( 1 );
34 mEnabledGroup->setChecked(
false );
46 mFillSymbolButton->setDialogTitle( tr(
"Fill Symbol" ) );
48 mFillSymbolButton->setToDefaultSymbol();
50 mComboJoinStyle->setPenJoinStyle( Qt::RoundJoin );
52 connect( mEnabledGroup, &QGroupBox::toggled,
this, &QgsSymbolBufferSettingsWidget::onWidgetChanged );
53 connect( mSpinWidth, qOverload< double >( &QgsDoubleSpinBox::valueChanged ),
this, &QgsSymbolBufferSettingsWidget::onWidgetChanged );
54 connect( mComboJoinStyle, qOverload< int >( &QComboBox::currentIndexChanged ),
this, &QgsSymbolBufferSettingsWidget::onWidgetChanged );
62 mEnabledGroup->setChecked( settings.
enabled() );
63 mSpinWidth->setValue( settings.
size() );
64 mSizeUnitWidget->setUnit( settings.
sizeUnit() );
66 mComboJoinStyle->setPenJoinStyle( settings.
joinStyle() );
69 mFillSymbolButton->setSymbol( fill->clone() );
70 mBlockUpdates =
false;
76 settings.
setEnabled( mEnabledGroup->isChecked() );
77 settings.
setSize( mSpinWidth->value() );
80 settings.
setJoinStyle( mComboJoinStyle->penJoinStyle() );
85void QgsSymbolBufferSettingsWidget::onWidgetChanged()
97 : QDialog( parent, f )
99 QVBoxLayout *vLayout =
new QVBoxLayout();
101 vLayout->addWidget( mWidget );
102 QDialogButtonBox *bbox =
new QDialogButtonBox( QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal );
103 connect( bbox, &QDialogButtonBox::accepted,
this, &QgsSymbolBufferSettingsDialog::accept );
104 connect( bbox, &QDialogButtonBox::rejected,
this, &QgsSymbolBufferSettingsDialog::reject );
105 vLayout->addWidget( bbox );
106 setLayout( vLayout );
107 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