28#include "moc_qgslabelsettingswidgetbase.cpp"
30using namespace Qt::StringLiterals;
54 if (
auto *lExpressionContext = mContext.expressionContext() )
55 return *lExpressionContext;
60 expContext << symbolScope;
63 const auto constAdditionalExpressionContextScopes = mContext.additionalExpressionContextScopes();
77void QgsLabelSettingsWidgetBase::createAuxiliaryField()
79 auto vectorLayer = qobject_cast< QgsVectorLayer * >( mLayer );
84 if ( !vectorLayer->auxiliaryLayer() )
91 if ( !vectorLayer->auxiliaryLayer() )
94 QgsPropertyOverrideButton *button = qobject_cast<QgsPropertyOverrideButton *>( sender() );
99 if ( !vectorLayer->auxiliaryLayer()->exists( def ) )
101 QgsNewAuxiliaryFieldDialog dlg( def, vectorLayer,
true,
this );
102 if ( dlg.exec() == QDialog::Accepted )
103 def = dlg.propertyDefinition();
107 if ( !vectorLayer->auxiliaryLayer()->exists( def ) )
113 property.setActive(
true );
124void QgsLabelSettingsWidgetBase::updateDataDefinedProperty()
126 QgsPropertyOverrideButton *button = qobject_cast<QgsPropertyOverrideButton *>( sender() );
141 const QList<QgsPropertyOverrideButton *> overrideButtons = findChildren<QgsPropertyOverrideButton *>();
155 auto vectorLayer = qobject_cast< QgsVectorLayer * >( mLayer );
172 setWindowTitle( widget->windowTitle() );
173 QVBoxLayout *vLayout =
new QVBoxLayout();
174 vLayout->addWidget( widget );
175 mButtonBox =
new QDialogButtonBox( QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal );
176 connect( mButtonBox, &QDialogButtonBox::accepted,
this, &QDialog::accept );
177 connect( mButtonBox, &QDialogButtonBox::rejected,
this, &QDialog::reject );
178 vLayout->addWidget( mButtonBox );
179 setLayout( vLayout );
181 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.