29#include <qdialogbuttonbox.h>
31#include "moc_qgsextentbufferdialog.cpp"
38 mExtentBufferSpinBox->setValue( mSymbol->extentBuffer() );
40 mExtentBufferUnitSelectionWidget->setShowMapScaleButton(
false );
42 mExtentBufferUnitSelectionWidget->setUnit( mSymbol->extentBufferSizeUnit() );
44 connect( mExtentBufferSpinBox,
static_cast<void (
QgsDoubleSpinBox::* )(
double )
>( &QgsDoubleSpinBox::valueChanged ),
this, [
this]() {
79 if ( QgsExpressionContext *lExpressionContext = mContext.expressionContext() )
80 return *lExpressionContext;
82 QgsExpressionContext expContext;
84 if ( mContext.mapCanvas() )
86 expContext = mContext.mapCanvas()->createExpressionContext();
107 return mExtentBufferSpinBox->value();
112 return mExtentBufferDDButton->toProperty();
121 QVBoxLayout *vLayout =
new QVBoxLayout();
123 vLayout->addWidget( mWidget );
125 QDialogButtonBox *bbox =
new QDialogButtonBox( QDialogButtonBox::Cancel | QDialogButtonBox::Help | QDialogButtonBox::Ok, Qt::Horizontal );
126 connect( bbox, &QDialogButtonBox::accepted,
this, &QgsExtentBufferDialog::accept );
127 connect( bbox, &QDialogButtonBox::rejected,
this, &QgsExtentBufferDialog::reject );
128 connect( bbox, &QDialogButtonBox::helpRequested,
this, &QgsExtentBufferDialog::showHelp );
130 vLayout->addWidget( bbox );
131 setLayout( vLayout );
133 setWindowTitle( tr(
"Extent Buffer" ) );
141 return mWidget->extentBuffer();
146 return mExtentBufferUnitSelectionWidget->unit();
154 return mWidget->sizeUnit();
162 return mWidget->dataDefinedProperty();
176void QgsExtentBufferDialog::showHelp()
178 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.
virtual QgsExpressionContext createExpressionContext() const =0
This method needs to be reimplemented in all classes which implement this interface and return an exp...
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.
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,...
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.
Represents a vector layer which manages a vector based dataset.