30 return *lExpressionContext;
35 expContext << symbolScope;
55 const auto unitSelectionWidgets = findChildren<QgsUnitSelectionWidget *>();
58 unitWidget->setMapCanvas( mContext.
mapCanvas() );
60 const auto symbolButtonWidgets = findChildren<QgsSymbolButton *>();
63 symbolWidget->setMapCanvas( mContext.
mapCanvas() );
64 symbolWidget->setMessageBar( mContext.
messageBar() );
82void QgsCalloutWidget::createAuxiliaryField()
108 property.setActive(
true );
117void QgsCalloutWidget::updateDataDefinedProperty()
131QgsSimpleLineCalloutWidget::QgsSimpleLineCalloutWidget(
QgsVectorLayer *vl, QWidget *parent )
138 mCalloutLineStyleButton->setDialogTitle( tr(
"Callout Symbol" ) );
139 mCalloutLineStyleButton->registerExpressionContextGenerator(
this );
141 mCalloutLineStyleButton->setLayer( vl );
150 connect( mMinCalloutLengthSpin,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleLineCalloutWidget::minimumLengthChanged );
153 connect( mOffsetFromAnchorSpin,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleLineCalloutWidget::offsetFromAnchorChanged );
155 connect( mOffsetFromLabelSpin,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleLineCalloutWidget::offsetFromLabelChanged );
157 connect( mDrawToAllPartsCheck, &QCheckBox::toggled,
this, &QgsSimpleLineCalloutWidget::drawToAllPartsToggled );
164 connect( mAnchorPointComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleLineCalloutWidget::mAnchorPointComboBox_currentIndexChanged );
176 connect( mLabelAnchorPointComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleLineCalloutWidget::mLabelAnchorPointComboBox_currentIndexChanged );
178 connect( mCalloutLineStyleButton, &
QgsSymbolButton::changed,
this, &QgsSimpleLineCalloutWidget::lineSymbolChanged );
180 connect( mCalloutBlendComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleLineCalloutWidget::mCalloutBlendComboBox_currentIndexChanged );
183void QgsSimpleLineCalloutWidget::setCallout(
QgsCallout *callout )
192 mMinCalloutWidthUnitWidget->blockSignals(
true );
193 mMinCalloutWidthUnitWidget->setUnit( mCallout->minimumLengthUnit() );
194 mMinCalloutWidthUnitWidget->setMapUnitScale( mCallout->minimumLengthMapUnitScale() );
195 mMinCalloutWidthUnitWidget->blockSignals(
false );
197 whileBlocking( mMinCalloutLengthSpin )->setValue( mCallout->minimumLength() );
199 mOffsetFromAnchorUnitWidget->blockSignals(
true );
200 mOffsetFromAnchorUnitWidget->setUnit( mCallout->offsetFromAnchorUnit() );
201 mOffsetFromAnchorUnitWidget->setMapUnitScale( mCallout->offsetFromAnchorMapUnitScale() );
202 mOffsetFromAnchorUnitWidget->blockSignals(
false );
203 mOffsetFromLabelUnitWidget->blockSignals(
true );
204 mOffsetFromLabelUnitWidget->setUnit( mCallout->offsetFromLabelUnit() );
205 mOffsetFromLabelUnitWidget->setMapUnitScale( mCallout->offsetFromLabelMapUnitScale() );
206 mOffsetFromLabelUnitWidget->blockSignals(
false );
207 whileBlocking( mOffsetFromAnchorSpin )->setValue( mCallout->offsetFromAnchor() );
208 whileBlocking( mOffsetFromLabelSpin )->setValue( mCallout->offsetFromLabel() );
210 whileBlocking( mCalloutLineStyleButton )->setSymbol( mCallout->lineSymbol()->clone() );
212 whileBlocking( mDrawToAllPartsCheck )->setChecked( mCallout->drawCalloutToAllParts() );
214 whileBlocking( mAnchorPointComboBox )->setCurrentIndex( mAnchorPointComboBox->findData(
static_cast< int >( callout->
anchorPoint() ) ) );
215 whileBlocking( mLabelAnchorPointComboBox )->setCurrentIndex( mLabelAnchorPointComboBox->findData(
static_cast< int >( callout->
labelAnchorPoint() ) ) );
217 whileBlocking( mCalloutBlendComboBox )->setBlendMode( mCallout->blendMode() );
236 mAnchorPointLbl->setEnabled( isPolygon );
237 mAnchorPointLbl->setVisible( isPolygon );
238 mAnchorPointComboBox->setEnabled( isPolygon );
239 mAnchorPointComboBox->setVisible( isPolygon );
240 mAnchorPointDDBtn->setEnabled( isPolygon );
241 mAnchorPointDDBtn->setVisible( isPolygon );
244QgsCallout *QgsSimpleLineCalloutWidget::callout()
246 return mCallout.get();
249void QgsSimpleLineCalloutWidget::minimumLengthChanged()
251 mCallout->setMinimumLength( mMinCalloutLengthSpin->value() );
255void QgsSimpleLineCalloutWidget::minimumLengthUnitWidgetChanged()
257 mCallout->setMinimumLengthUnit( mMinCalloutWidthUnitWidget->unit() );
258 mCallout->setMinimumLengthMapUnitScale( mMinCalloutWidthUnitWidget->getMapUnitScale() );
262void QgsSimpleLineCalloutWidget::offsetFromAnchorUnitWidgetChanged()
264 mCallout->setOffsetFromAnchorUnit( mOffsetFromAnchorUnitWidget->unit() );
265 mCallout->setOffsetFromAnchorMapUnitScale( mOffsetFromAnchorUnitWidget->getMapUnitScale() );
269void QgsSimpleLineCalloutWidget::offsetFromAnchorChanged()
271 mCallout->setOffsetFromAnchor( mOffsetFromAnchorSpin->value() );
275void QgsSimpleLineCalloutWidget::offsetFromLabelUnitWidgetChanged()
277 mCallout->setOffsetFromLabelUnit( mOffsetFromLabelUnitWidget->unit() );
278 mCallout->setOffsetFromLabelMapUnitScale( mOffsetFromLabelUnitWidget->getMapUnitScale() );
282void QgsSimpleLineCalloutWidget::offsetFromLabelChanged()
284 mCallout->setOffsetFromLabel( mOffsetFromLabelSpin->value() );
288void QgsSimpleLineCalloutWidget::lineSymbolChanged()
290 mCallout->setLineSymbol( mCalloutLineStyleButton->clonedSymbol<
QgsLineSymbol >() );
294void QgsSimpleLineCalloutWidget::mAnchorPointComboBox_currentIndexChanged(
int index )
296 mCallout->setAnchorPoint(
static_cast<QgsCallout::AnchorPoint>( mAnchorPointComboBox->itemData( index ).toInt() ) );
300void QgsSimpleLineCalloutWidget::mLabelAnchorPointComboBox_currentIndexChanged(
int index )
306void QgsSimpleLineCalloutWidget::mCalloutBlendComboBox_currentIndexChanged(
int )
308 mCallout->setBlendMode( mCalloutBlendComboBox->blendMode() );
312void QgsSimpleLineCalloutWidget::drawToAllPartsToggled(
bool active )
314 mCallout->setDrawCalloutToAllParts( active );
323QgsManhattanLineCalloutWidget::QgsManhattanLineCalloutWidget(
QgsVectorLayer *vl, QWidget *parent )
324 : QgsSimpleLineCalloutWidget( vl, parent )
334QgsCurvedLineCalloutWidget::QgsCurvedLineCalloutWidget(
QgsVectorLayer *vl, QWidget *parent )
341 mCalloutLineStyleButton->setDialogTitle( tr(
"Callout Symbol" ) );
342 mCalloutLineStyleButton->registerExpressionContextGenerator(
this );
344 mCalloutLineStyleButton->setLayer( vl );
353 connect( mMinCalloutLengthSpin,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsCurvedLineCalloutWidget::minimumLengthChanged );
356 connect( mOffsetFromAnchorSpin,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsCurvedLineCalloutWidget::offsetFromAnchorChanged );
358 connect( mOffsetFromLabelSpin,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsCurvedLineCalloutWidget::offsetFromLabelChanged );
360 connect( mDrawToAllPartsCheck, &QCheckBox::toggled,
this, &QgsCurvedLineCalloutWidget::drawToAllPartsToggled );
365 connect( mOrientationComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, [ = ](
int index )
376 connect( mAnchorPointComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsCurvedLineCalloutWidget::mAnchorPointComboBox_currentIndexChanged );
388 connect( mLabelAnchorPointComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsCurvedLineCalloutWidget::mLabelAnchorPointComboBox_currentIndexChanged );
390 connect( mCalloutLineStyleButton, &
QgsSymbolButton::changed,
this, &QgsCurvedLineCalloutWidget::lineSymbolChanged );
392 connect( mCurvatureSlider, &QSlider::valueChanged,
this, [ = ](
int value ) { mCurvatureSpinBox->setValue( value / 10.0 ); } );
393 connect( mCurvatureSpinBox,
static_cast < void (
QgsDoubleSpinBox::* )(
double )
> ( &QgsDoubleSpinBox::valueChanged ),
this, [ = ](
double value ) {
whileBlocking( mCurvatureSlider )->setValue( value * 10 ); } );
394 connect( mCurvatureSpinBox,
static_cast < void (
QgsDoubleSpinBox::* )(
double )
> ( &QgsDoubleSpinBox::valueChanged ),
this, [ = ](
double value )
396 mCallout->setCurvature( value / 100.0 );
400 connect( mCalloutBlendComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsCurvedLineCalloutWidget::mCalloutBlendComboBox_currentIndexChanged );
403void QgsCurvedLineCalloutWidget::setCallout(
QgsCallout *callout )
412 mMinCalloutWidthUnitWidget->blockSignals(
true );
413 mMinCalloutWidthUnitWidget->setUnit( mCallout->minimumLengthUnit() );
414 mMinCalloutWidthUnitWidget->setMapUnitScale( mCallout->minimumLengthMapUnitScale() );
415 mMinCalloutWidthUnitWidget->blockSignals(
false );
417 whileBlocking( mMinCalloutLengthSpin )->setValue( mCallout->minimumLength() );
419 mOffsetFromAnchorUnitWidget->blockSignals(
true );
420 mOffsetFromAnchorUnitWidget->setUnit( mCallout->offsetFromAnchorUnit() );
421 mOffsetFromAnchorUnitWidget->setMapUnitScale( mCallout->offsetFromAnchorMapUnitScale() );
422 mOffsetFromAnchorUnitWidget->blockSignals(
false );
423 mOffsetFromLabelUnitWidget->blockSignals(
true );
424 mOffsetFromLabelUnitWidget->setUnit( mCallout->offsetFromLabelUnit() );
425 mOffsetFromLabelUnitWidget->setMapUnitScale( mCallout->offsetFromLabelMapUnitScale() );
426 mOffsetFromLabelUnitWidget->blockSignals(
false );
427 whileBlocking( mOffsetFromAnchorSpin )->setValue( mCallout->offsetFromAnchor() );
428 whileBlocking( mOffsetFromLabelSpin )->setValue( mCallout->offsetFromLabel() );
430 whileBlocking( mCalloutLineStyleButton )->setSymbol( mCallout->lineSymbol()->clone() );
432 whileBlocking( mDrawToAllPartsCheck )->setChecked( mCallout->drawCalloutToAllParts() );
434 whileBlocking( mOrientationComboBox )->setCurrentIndex( mOrientationComboBox->findData(
static_cast< int >( mCallout->orientation() ) ) );
436 whileBlocking( mAnchorPointComboBox )->setCurrentIndex( mAnchorPointComboBox->findData(
static_cast< int >( callout->
anchorPoint() ) ) );
437 whileBlocking( mLabelAnchorPointComboBox )->setCurrentIndex( mLabelAnchorPointComboBox->findData(
static_cast< int >( callout->
labelAnchorPoint() ) ) );
439 whileBlocking( mCalloutBlendComboBox )->setBlendMode( mCallout->blendMode() );
441 whileBlocking( mCurvatureSpinBox )->setValue( mCallout->curvature() * 100.0 );
442 whileBlocking( mCurvatureSlider )->setValue( mCallout->curvature() * 1000.0 );
463 mAnchorPointLbl->setEnabled( isPolygon );
464 mAnchorPointLbl->setVisible( isPolygon );
465 mAnchorPointComboBox->setEnabled( isPolygon );
466 mAnchorPointComboBox->setVisible( isPolygon );
467 mAnchorPointDDBtn->setEnabled( isPolygon );
468 mAnchorPointDDBtn->setVisible( isPolygon );
471QgsCallout *QgsCurvedLineCalloutWidget::callout()
473 return mCallout.get();
476void QgsCurvedLineCalloutWidget::minimumLengthChanged()
478 mCallout->setMinimumLength( mMinCalloutLengthSpin->value() );
482void QgsCurvedLineCalloutWidget::minimumLengthUnitWidgetChanged()
484 mCallout->setMinimumLengthUnit( mMinCalloutWidthUnitWidget->unit() );
485 mCallout->setMinimumLengthMapUnitScale( mMinCalloutWidthUnitWidget->getMapUnitScale() );
489void QgsCurvedLineCalloutWidget::offsetFromAnchorUnitWidgetChanged()
491 mCallout->setOffsetFromAnchorUnit( mOffsetFromAnchorUnitWidget->unit() );
492 mCallout->setOffsetFromAnchorMapUnitScale( mOffsetFromAnchorUnitWidget->getMapUnitScale() );
496void QgsCurvedLineCalloutWidget::offsetFromAnchorChanged()
498 mCallout->setOffsetFromAnchor( mOffsetFromAnchorSpin->value() );
502void QgsCurvedLineCalloutWidget::offsetFromLabelUnitWidgetChanged()
504 mCallout->setOffsetFromLabelUnit( mOffsetFromLabelUnitWidget->unit() );
505 mCallout->setOffsetFromLabelMapUnitScale( mOffsetFromLabelUnitWidget->getMapUnitScale() );
509void QgsCurvedLineCalloutWidget::offsetFromLabelChanged()
511 mCallout->setOffsetFromLabel( mOffsetFromLabelSpin->value() );
515void QgsCurvedLineCalloutWidget::lineSymbolChanged()
517 mCallout->setLineSymbol( mCalloutLineStyleButton->clonedSymbol<
QgsLineSymbol >() );
521void QgsCurvedLineCalloutWidget::mAnchorPointComboBox_currentIndexChanged(
int index )
523 mCallout->setAnchorPoint(
static_cast<QgsCallout::AnchorPoint>( mAnchorPointComboBox->itemData( index ).toInt() ) );
527void QgsCurvedLineCalloutWidget::mLabelAnchorPointComboBox_currentIndexChanged(
int index )
533void QgsCurvedLineCalloutWidget::mCalloutBlendComboBox_currentIndexChanged(
int )
535 mCallout->setBlendMode( mCalloutBlendComboBox->blendMode() );
539void QgsCurvedLineCalloutWidget::drawToAllPartsToggled(
bool active )
541 mCallout->setDrawCalloutToAllParts( active );
550QgsBalloonCalloutWidget::QgsBalloonCalloutWidget(
QgsVectorLayer *vl, QWidget *parent )
557 mCalloutFillStyleButton->setDialogTitle( tr(
"Balloon Symbol" ) );
558 mCalloutFillStyleButton->registerExpressionContextGenerator(
this );
560 mCalloutFillStyleButton->setLayer( vl );
570 mSpinBottomMargin->setClearValue( 0 );
571 mSpinTopMargin->setClearValue( 0 );
572 mSpinRightMargin->setClearValue( 0 );
573 mSpinLeftMargin->setClearValue( 0 );
574 mWedgeWidthSpin->setClearValue( 2.64 );
575 mCornerRadiusSpin->setClearValue( 0.0 );
578 connect( mOffsetFromAnchorSpin,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsBalloonCalloutWidget::offsetFromAnchorChanged );
585 connect( mAnchorPointComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsBalloonCalloutWidget::mAnchorPointComboBox_currentIndexChanged );
589 connect( mSpinBottomMargin, qOverload< double >( &QDoubleSpinBox::valueChanged ),
this, [ = ](
double value )
593 mCallout->setMargins( margins );
596 connect( mSpinTopMargin, qOverload< double >( &QDoubleSpinBox::valueChanged ),
this, [ = ](
double value )
600 mCallout->setMargins( margins );
603 connect( mSpinLeftMargin, qOverload< double >( &QDoubleSpinBox::valueChanged ),
this, [ = ](
double value )
607 mCallout->setMargins( margins );
610 connect( mSpinRightMargin, qOverload< double >( &QDoubleSpinBox::valueChanged ),
this, [ = ](
double value )
614 mCallout->setMargins( margins );
619 mCallout->setMarginsUnit( mMarginUnitWidget->unit() );
625 mCallout->setWedgeWidthUnit( mWedgeWidthUnitWidget->unit() );
626 mCallout->setWedgeWidthMapUnitScale( mWedgeWidthUnitWidget->getMapUnitScale() );
629 connect( mWedgeWidthSpin, qOverload< double >( &QDoubleSpinBox::valueChanged ),
this, [ = ](
double value )
631 mCallout->setWedgeWidth( value );
637 mCallout->setCornerRadiusUnit( mCornerRadiusUnitWidget->unit() );
638 mCallout->setCornerRadiusMapUnitScale( mCornerRadiusUnitWidget->getMapUnitScale() );
641 connect( mCornerRadiusSpin, qOverload< double >( &QDoubleSpinBox::valueChanged ),
this, [ = ](
double value )
643 mCallout->setCornerRadius( value );
647 connect( mCalloutBlendComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsBalloonCalloutWidget::mCalloutBlendComboBox_currentIndexChanged );
650void QgsBalloonCalloutWidget::setCallout(
QgsCallout *callout )
659 mOffsetFromAnchorUnitWidget->blockSignals(
true );
660 mOffsetFromAnchorUnitWidget->setUnit( mCallout->offsetFromAnchorUnit() );
661 mOffsetFromAnchorUnitWidget->setMapUnitScale( mCallout->offsetFromAnchorMapUnitScale() );
662 mOffsetFromAnchorUnitWidget->blockSignals(
false );
663 whileBlocking( mOffsetFromAnchorSpin )->setValue( mCallout->offsetFromAnchor() );
665 whileBlocking( mSpinBottomMargin )->setValue( mCallout->margins().bottom() );
666 whileBlocking( mSpinTopMargin )->setValue( mCallout->margins().top() );
667 whileBlocking( mSpinLeftMargin )->setValue( mCallout->margins().left() );
668 whileBlocking( mSpinRightMargin )->setValue( mCallout->margins().right() );
669 whileBlocking( mMarginUnitWidget )->setUnit( mCallout->marginsUnit() );
671 mWedgeWidthUnitWidget->blockSignals(
true );
672 mWedgeWidthUnitWidget->setUnit( mCallout->wedgeWidthUnit() );
673 mWedgeWidthUnitWidget->setMapUnitScale( mCallout->wedgeWidthMapUnitScale() );
674 mWedgeWidthUnitWidget->blockSignals(
false );
675 whileBlocking( mWedgeWidthSpin )->setValue( mCallout->wedgeWidth() );
677 mCornerRadiusUnitWidget->blockSignals(
true );
678 mCornerRadiusUnitWidget->setUnit( mCallout->cornerRadiusUnit() );
679 mCornerRadiusUnitWidget->setMapUnitScale( mCallout->cornerRadiusMapUnitScale() );
680 mCornerRadiusUnitWidget->blockSignals(
false );
681 whileBlocking( mCornerRadiusSpin )->setValue( mCallout->cornerRadius() );
683 whileBlocking( mCalloutFillStyleButton )->setSymbol( mCallout->fillSymbol()->clone() );
685 whileBlocking( mAnchorPointComboBox )->setCurrentIndex( mAnchorPointComboBox->findData(
static_cast< int >( callout->
anchorPoint() ) ) );
687 whileBlocking( mCalloutBlendComboBox )->setBlendMode( mCallout->blendMode() );
703 mAnchorPointLbl->setEnabled( isPolygon );
704 mAnchorPointLbl->setVisible( isPolygon );
705 mAnchorPointComboBox->setEnabled( isPolygon );
706 mAnchorPointComboBox->setVisible( isPolygon );
707 mAnchorPointDDBtn->setEnabled( isPolygon );
708 mAnchorPointDDBtn->setVisible( isPolygon );
713 return mCallout.get();
716void QgsBalloonCalloutWidget::offsetFromAnchorUnitWidgetChanged()
718 mCallout->setOffsetFromAnchorUnit( mOffsetFromAnchorUnitWidget->unit() );
719 mCallout->setOffsetFromAnchorMapUnitScale( mOffsetFromAnchorUnitWidget->getMapUnitScale() );
723void QgsBalloonCalloutWidget::offsetFromAnchorChanged()
725 mCallout->setOffsetFromAnchor( mOffsetFromAnchorSpin->value() );
729void QgsBalloonCalloutWidget::fillSymbolChanged()
731 mCallout->setFillSymbol( mCalloutFillStyleButton->clonedSymbol<
QgsFillSymbol >() );
735void QgsBalloonCalloutWidget::mAnchorPointComboBox_currentIndexChanged(
int index )
737 mCallout->setAnchorPoint(
static_cast<QgsCallout::AnchorPoint>( mAnchorPointComboBox->itemData( index ).toInt() ) );
741void QgsBalloonCalloutWidget::mCalloutBlendComboBox_currentIndexChanged(
int )
743 mCallout->setBlendMode( mCalloutBlendComboBox->blendMode() );
GeometryType
The geometry types are used to group Qgis::WkbType in a coarse way.
@ Millimeters
Millimeters.
@ Points
Points (e.g., for font sizes)
@ MetersInMapUnits
Meters value as Map units.
static QString nameFromProperty(const QgsPropertyDefinition &def, bool joined=false)
Returns the name of the auxiliary field for a property definition.
bool addAuxiliaryField(const QgsPropertyDefinition &definition)
Adds an auxiliary field for the given property.
bool exists(const QgsPropertyDefinition &definition) const
Returns true if the property is stored in the layer already, false otherwise.
A cartoon talking bubble callout style.
Abstract base class for callout renderers.
virtual QgsCallout * clone() const =0
Duplicates a callout by creating a deep copy of the callout.
QgsPropertyCollection & dataDefinedProperties()
Returns a reference to the callout's property collection, used for data defined overrides.
static QgsPropertiesDefinition propertyDefinitions()
Returns the definitions for data defined properties available for use in callouts.
AnchorPoint anchorPoint() const
Returns the feature's anchor point position.
LabelAnchorPoint labelAnchorPoint() const
Returns the label's anchor point position.
AnchorPoint
Feature's anchor point position.
@ PointOnExterior
A point on the surface's outline closest to the label is used as anchor for polygon geometries.
@ Centroid
The surface's centroid is used as anchor for polygon geometries.
@ PointOnSurface
A point guaranteed to be on the surface is used as anchor for polygon geometries.
@ PoleOfInaccessibility
The surface's pole of inaccessibility used as anchor for polygon geometries.
LabelAnchorPoint
Label's anchor point position.
@ LabelPointOnExterior
The point on the label's boundary closest to the feature.
@ LabelBottomLeft
Bottom left corner of the label's boundary.
@ LabelBottomMiddle
Bottom middle of the label's boundary.
@ LabelMiddleLeft
Middle left of the label's boundary.
@ LabelBottomRight
Bottom right corner of the label's boundary.
@ LabelMiddleRight
Middle right of the label's boundary.
@ LabelTopMiddle
Top middle of the label's boundary.
@ LabelTopLeft
Top left corner of the label's boundary.
@ LabelCentroid
The labe's centroid.
@ LabelTopRight
Top right corner of the label's boundary.
Property
Data definable properties.
@ DestinationX
X-coordinate of callout destination (feature anchor) (since QGIS 3.20)
@ Curvature
Curvature of curved line callouts (since QGIS 3.20)
@ BlendMode
Callout blend mode (since QGIS 3.20)
@ DestinationY
Y-coordinate of callout destination (feature anchor) (since QGIS 3.20)
@ CornerRadius
Balloon callout corner radius (since QGIS 3.20)
@ AnchorPointPosition
Feature's anchor point position.
@ LabelAnchorPointPosition
Label's anchor point position.
@ DrawCalloutToAllParts
Whether callout lines should be drawn to all feature parts.
@ OffsetFromAnchor
Distance to offset lines from anchor points.
@ WedgeWidth
Balloon callout wedge width (since QGIS 3.20)
@ OriginY
Y-coordinate of callout origin (label anchor) (since QGIS 3.20)
@ OffsetFromLabel
Distance to offset lines from label area.
@ Orientation
Orientation of curved line callouts (since QGIS 3.20)
@ OriginX
X-coordinate of callout origin (label anchor) (since QGIS 3.20)
@ MinimumCalloutLength
Minimum length of callouts.
@ Margins
Margin from text (since QGIS 3.20)
Draws curved lines as callouts.
Orientation
Curve orientation.
@ Clockwise
Curve lines in a clockwise direction.
@ CounterClockwise
Curve lines in a counter-clockwise direction.
@ Automatic
Automatically choose most cartographically pleasing orientation based on label and callout arrangemen...
The QgsSpinBox is a spin box with a clear button that will set the value to the defined clear value.
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.
A fill symbol type, for rendering Polygon and MultiPolygon geometries.
A line symbol type, for rendering LineString and MultiLineString geometries.
The QgsMargins class defines the four margins of a rectangle.
void setBottom(double bottom)
Sets the bottom margin to bottom.
void setLeft(double left)
Sets the left margin to left.
void setRight(double right)
Sets the right margin to right.
void setTop(double top)
Sets the top margin to top.
A dialog to create a new auxiliary layer.
void setProperty(int key, const QgsProperty &property)
Adds a property to the collection and takes ownership of it.
Definition for a property.
A store for object properties.
void setField(const QString &field)
Sets the field name the property references.
A simple direct line callout style.
Contains settings which reflect the context in which a symbol (or renderer) widget is shown,...
QList< QgsExpressionContextScope > additionalExpressionContextScopes() const
Returns the list of additional expression context scopes to show as available within the layer.
QList< QgsExpressionContextScope * > globalProjectAtlasMapLayerScopes(const QgsMapLayer *layer) const
Returns list of scopes: global, project, atlas, map, layer.
QgsExpressionContext * expressionContext() const
Returns the expression context used for the widget, if set.
QgsMapCanvas * mapCanvas() const
Returns the map canvas associated with the widget.
QgsMessageBar * messageBar() const
Returns the message bar associated with the widget.
QList< Qgis::RenderUnit > RenderUnitList
List of render units.
Represents a vector layer which manages a vector based data sets.
QgsAuxiliaryLayer * auxiliaryLayer()
Returns the current auxiliary layer.
QgsSignalBlocker< Object > whileBlocking(Object *object)
Temporarily blocks signals from a QObject while calling a single method from the object.
Single variable definition for use within a QgsExpressionContextScope.