17#include "moc_qgsextentbufferdialog.cpp"
18#include "qdialogbuttonbox.h"
35 mExtentBufferSpinBox->setValue( mSymbol->
extentBuffer() );
37 mExtentBufferUnitSelectionWidget->setShowMapScaleButton(
false );
41 connect( mExtentBufferSpinBox,
static_cast<void (
QgsDoubleSpinBox::* )(
double )
>( &QgsDoubleSpinBox::valueChanged ),
this, [=]() {
77 return *lExpressionContext;
104 return mExtentBufferSpinBox->value();
109 return mExtentBufferDDButton->toProperty();
118 QVBoxLayout *vLayout =
new QVBoxLayout();
120 vLayout->addWidget( mWidget );
122 QDialogButtonBox *bbox =
new QDialogButtonBox( QDialogButtonBox::Cancel | QDialogButtonBox::Help | QDialogButtonBox::Ok, Qt::Horizontal );
123 connect( bbox, &QDialogButtonBox::accepted,
this, &QgsExtentBufferDialog::accept );
124 connect( bbox, &QDialogButtonBox::rejected,
this, &QgsExtentBufferDialog::reject );
125 connect( bbox, &QDialogButtonBox::helpRequested,
this, &QgsExtentBufferDialog::showHelp );
127 vLayout->addWidget( bbox );
128 setLayout( vLayout );
130 setWindowTitle( tr(
"Extent Buffer" ) );
143 return mExtentBufferUnitSelectionWidget->unit();
173void QgsExtentBufferDialog::showHelp()
175 QgsHelp::openHelp( QStringLiteral(
"working_with_vector/vector_properties.html#extent-buffer" ) );
RenderUnit
Rendering size units.
@ Millimeters
Millimeters.
@ Points
Points (e.g., for font sizes)
@ MetersInMapUnits
Meters value as Map units.
The QgsSpinBox is a spin box with a clear button that will set the value to the defined clear value.
static QgsExpressionContextScope * projectScope(const QgsProject *project)
Creates a new scope which contains variables and functions relating to a QGIS project.
static QgsExpressionContextScope * atlasScope(const QgsLayoutAtlas *atlas)
Creates a new scope which contains variables and functions relating to a QgsLayoutAtlas.
static QgsExpressionContextScope * mapSettingsScope(const QgsMapSettings &mapSettings)
Creates a new scope which contains variables and functions relating to a QgsMapSettings object.
static QgsExpressionContextScope * layerScope(const QgsMapLayer *layer)
Creates a new scope which contains variables and functions relating to a QgsMapLayer.
static QgsExpressionContextScope * globalScope()
Creates a new scope which contains variables and functions relating to the global QGIS context.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
void setOriginalValueVariable(const QVariant &value)
Sets the original value variable value for the context.
void setHighlightedVariables(const QStringList &variableNames)
Sets the list of variable names within the context intended to be highlighted to the user.
static const QString EXPR_ORIGINAL_VALUE
Inbuilt variable name for value original value variable.
void setContext(const QgsSymbolWidgetContext &context)
Sets the context in which widget is shown, e.g., the associated map canvas and expression contexts.
QgsExtentBufferDialog(QgsSymbol *symbol, QgsVectorLayer *layer, QWidget *parent=nullptr)
Constructor for QgsExtentBufferDialog.
QgsProperty dataDefinedProperty() const
Returns the extent buffer value currently set in the widget.
QgsExtentBufferWidget * widget() const
Returns the data defined property currently set in the widget.
double extentBuffer() const
Returns the extent buffer value currently set in the widget.
Qgis::RenderUnit sizeUnit() const
Returns the extent buffer unit currently set in the widget.
static void openHelp(const QString &key)
Opens help topic for the given help key using default system web browser.
QgsExpressionContext createExpressionContext() const override
This method needs to be reimplemented in all classes which implement this interface and return an exp...
The QgsMapSettings class contains configuration for rendering of the map.
static QgsProject * instance()
Returns the QgsProject singleton instance.
A store for object properties.
Contains settings which reflect the context in which a symbol (or renderer) widget is shown,...
QgsExpressionContext * expressionContext() const
Returns the expression context used for the widget, if set.
QgsMapCanvas * mapCanvas() const
Returns the map canvas associated with the widget.
Abstract base class for all rendered symbols.
Property
Data definable properties.
@ ExtentBuffer
Extent buffer.
QgsPropertyCollection & dataDefinedProperties()
Returns a reference to the symbol's property collection, used for data defined overrides.
static const QgsPropertiesDefinition & propertyDefinitions()
Returns the symbol property definitions.
Qgis::RenderUnit extentBufferSizeUnit() const
Returns the units for the buffer size.
double extentBuffer() const
Returns the symbol's extent buffer.
Represents a vector layer which manages a vector based data sets.