26#include "moc_qgslabelsettingswidgetbase.cpp"
50 if (
auto *lExpressionContext = mContext.expressionContext() )
51 return *lExpressionContext;
56 expContext << symbolScope;
59 const auto constAdditionalExpressionContextScopes = mContext.additionalExpressionContextScopes();
73void QgsLabelSettingsWidgetBase::createAuxiliaryField()
75 auto vectorLayer = qobject_cast< QgsVectorLayer * >( mLayer );
80 if ( !vectorLayer->auxiliaryLayer() )
87 if ( !vectorLayer->auxiliaryLayer() )
90 QgsPropertyOverrideButton *button = qobject_cast<QgsPropertyOverrideButton *>( sender() );
95 if ( !vectorLayer->auxiliaryLayer()->exists( def ) )
97 QgsNewAuxiliaryFieldDialog dlg( def, vectorLayer,
true,
this );
98 if ( dlg.exec() == QDialog::Accepted )
99 def = dlg.propertyDefinition();
103 if ( !vectorLayer->auxiliaryLayer()->exists( def ) )
109 property.setActive(
true );
120void QgsLabelSettingsWidgetBase::updateDataDefinedProperty()
122 QgsPropertyOverrideButton *button = qobject_cast<QgsPropertyOverrideButton *>( sender() );
137 const QList<QgsPropertyOverrideButton *> overrideButtons = findChildren<QgsPropertyOverrideButton *>();
151 auto vectorLayer = qobject_cast< QgsVectorLayer * >( mLayer );
168 setWindowTitle( widget->windowTitle() );
169 QVBoxLayout *vLayout =
new QVBoxLayout();
170 vLayout->addWidget( widget );
171 mButtonBox =
new QDialogButtonBox( QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal );
172 connect( mButtonBox, &QDialogButtonBox::accepted,
this, &QDialog::accept );
173 connect( mButtonBox, &QDialogButtonBox::rejected,
this, &QDialog::reject );
174 vLayout->addWidget( mButtonBox );
175 setLayout( vLayout );
177 setObjectName( QStringLiteral(
"QgsLabelSettingsWidgetDialog" ) );
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.