28#include "moc_qgslabelsettingswidgetbase.cpp"
30using namespace Qt::StringLiterals;
52 if (
auto *lExpressionContext = mContext.expressionContext() )
53 return *lExpressionContext;
58 expContext << symbolScope;
61 const auto constAdditionalExpressionContextScopes = mContext.additionalExpressionContextScopes();
75void QgsLabelSettingsWidgetBase::createAuxiliaryField()
77 auto vectorLayer = qobject_cast< QgsVectorLayer * >( mLayer );
82 if ( !vectorLayer->auxiliaryLayer() )
89 if ( !vectorLayer->auxiliaryLayer() )
92 QgsPropertyOverrideButton *button = qobject_cast<QgsPropertyOverrideButton *>( sender() );
97 if ( !vectorLayer->auxiliaryLayer()->exists( def ) )
99 QgsNewAuxiliaryFieldDialog dlg( def, vectorLayer,
true,
this );
100 if ( dlg.exec() == QDialog::Accepted )
101 def = dlg.propertyDefinition();
105 if ( !vectorLayer->auxiliaryLayer()->exists( def ) )
111 property.setActive(
true );
122void QgsLabelSettingsWidgetBase::updateDataDefinedProperty()
124 QgsPropertyOverrideButton *button = qobject_cast<QgsPropertyOverrideButton *>( sender() );
139 const QList<QgsPropertyOverrideButton *> overrideButtons = findChildren<QgsPropertyOverrideButton *>();
152 auto vectorLayer = qobject_cast< QgsVectorLayer * >( mLayer );
169 setWindowTitle( widget->windowTitle() );
170 QVBoxLayout *vLayout =
new QVBoxLayout();
171 vLayout->addWidget( widget );
172 mButtonBox =
new QDialogButtonBox( QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal );
173 connect( mButtonBox, &QDialogButtonBox::accepted,
this, &QDialog::accept );
174 connect( mButtonBox, &QDialogButtonBox::rejected,
this, &QDialog::reject );
175 vLayout->addWidget( mButtonBox );
176 setLayout( vLayout );
178 setObjectName( u
"QgsLabelSettingsWidgetDialog"_s );
GeometryType
The geometry types are used to group Qgis::WkbType in a coarse way.
static QString nameFromProperty(const QgsPropertyDefinition &def, bool joined=false)
Returns the name of the auxiliary field for a property definition.
Single scope for storing variables and functions for use within a QgsExpressionContext.
void addVariable(const QgsExpressionContextScope::StaticVariable &variable)
Adds a variable into the context scope.
static QgsExpressionContextScope * updateSymbolScope(const QgsSymbol *symbol, QgsExpressionContextScope *symbolScope=nullptr)
Updates a symbol scope related to a QgsSymbol to an expression 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.
static const QString EXPR_SYMBOL_COLOR
Inbuilt variable name for symbol color variable.
void appendScope(QgsExpressionContextScope *scope)
Appends a scope to the end of 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.
static void enableAutoGeometryRestore(QWidget *widget, const QString &key=QString())
Register the widget to allow its position to be automatically saved and restored when open and closed...
Base class for all map layer types.
A dialog to create a new auxiliary layer.
Property
Data definable properties.
static const QgsPropertiesDefinition & propertyDefinitions()
Returns the labeling property definitions.
A grouped map of multiple QgsProperty objects, each referenced by an integer key value.
void setField(const QString &field)
Sets the field name the property references.
Contains settings which reflect the context in which a symbol (or renderer) widget is shown,...
Single variable definition for use within a QgsExpressionContextScope.