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()
112 property.setActive(
true );
121void QgsCalloutWidget::updateDataDefinedProperty()
135QgsSimpleLineCalloutWidget::QgsSimpleLineCalloutWidget(
QgsMapLayer *vl, QWidget *parent )
142 mCalloutLineStyleButton->setDialogTitle( tr(
"Callout Symbol" ) );
143 mCalloutLineStyleButton->registerExpressionContextGenerator(
this );
145 mCalloutLineStyleButton->setLayer( qobject_cast< QgsVectorLayer * >( vl ) );
154 connect( mMinCalloutLengthSpin,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleLineCalloutWidget::minimumLengthChanged );
157 connect( mOffsetFromAnchorSpin,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleLineCalloutWidget::offsetFromAnchorChanged );
159 connect( mOffsetFromLabelSpin,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleLineCalloutWidget::offsetFromLabelChanged );
161 connect( mDrawToAllPartsCheck, &QCheckBox::toggled,
this, &QgsSimpleLineCalloutWidget::drawToAllPartsToggled );
168 connect( mAnchorPointComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleLineCalloutWidget::mAnchorPointComboBox_currentIndexChanged );
180 connect( mLabelAnchorPointComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleLineCalloutWidget::mLabelAnchorPointComboBox_currentIndexChanged );
182 connect( mCalloutLineStyleButton, &
QgsSymbolButton::changed,
this, &QgsSimpleLineCalloutWidget::lineSymbolChanged );
184 connect( mCalloutBlendComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleLineCalloutWidget::mCalloutBlendComboBox_currentIndexChanged );
186 mPlacementDDGroupBox->setVisible( qobject_cast< QgsVectorLayer * >( vl ) );
189void QgsSimpleLineCalloutWidget::setCallout(
const QgsCallout *callout )
198 mMinCalloutWidthUnitWidget->blockSignals(
true );
199 mMinCalloutWidthUnitWidget->setUnit( mCallout->minimumLengthUnit() );
200 mMinCalloutWidthUnitWidget->setMapUnitScale( mCallout->minimumLengthMapUnitScale() );
201 mMinCalloutWidthUnitWidget->blockSignals(
false );
203 whileBlocking( mMinCalloutLengthSpin )->setValue( mCallout->minimumLength() );
205 mOffsetFromAnchorUnitWidget->blockSignals(
true );
206 mOffsetFromAnchorUnitWidget->setUnit( mCallout->offsetFromAnchorUnit() );
207 mOffsetFromAnchorUnitWidget->setMapUnitScale( mCallout->offsetFromAnchorMapUnitScale() );
208 mOffsetFromAnchorUnitWidget->blockSignals(
false );
209 mOffsetFromLabelUnitWidget->blockSignals(
true );
210 mOffsetFromLabelUnitWidget->setUnit( mCallout->offsetFromLabelUnit() );
211 mOffsetFromLabelUnitWidget->setMapUnitScale( mCallout->offsetFromLabelMapUnitScale() );
212 mOffsetFromLabelUnitWidget->blockSignals(
false );
213 whileBlocking( mOffsetFromAnchorSpin )->setValue( mCallout->offsetFromAnchor() );
214 whileBlocking( mOffsetFromLabelSpin )->setValue( mCallout->offsetFromLabel() );
216 whileBlocking( mCalloutLineStyleButton )->setSymbol( mCallout->lineSymbol()->clone() );
218 whileBlocking( mDrawToAllPartsCheck )->setChecked( mCallout->drawCalloutToAllParts() );
220 whileBlocking( mAnchorPointComboBox )->setCurrentIndex( mAnchorPointComboBox->findData(
static_cast< int >( callout->
anchorPoint() ) ) );
221 whileBlocking( mLabelAnchorPointComboBox )->setCurrentIndex( mLabelAnchorPointComboBox->findData(
static_cast< int >( callout->
labelAnchorPoint() ) ) );
223 whileBlocking( mCalloutBlendComboBox )->setBlendMode( mCallout->blendMode() );
242 mAnchorPointLbl->setEnabled( isPolygon );
243 mAnchorPointLbl->setVisible( isPolygon );
244 mAnchorPointComboBox->setEnabled( isPolygon );
245 mAnchorPointComboBox->setVisible( isPolygon );
246 mAnchorPointDDBtn->setEnabled( isPolygon );
247 mAnchorPointDDBtn->setVisible( isPolygon );
250QgsCallout *QgsSimpleLineCalloutWidget::callout()
252 return mCallout.get();
255void QgsSimpleLineCalloutWidget::minimumLengthChanged()
257 mCallout->setMinimumLength( mMinCalloutLengthSpin->value() );
261void QgsSimpleLineCalloutWidget::minimumLengthUnitWidgetChanged()
263 mCallout->setMinimumLengthUnit( mMinCalloutWidthUnitWidget->unit() );
264 mCallout->setMinimumLengthMapUnitScale( mMinCalloutWidthUnitWidget->getMapUnitScale() );
268void QgsSimpleLineCalloutWidget::offsetFromAnchorUnitWidgetChanged()
270 mCallout->setOffsetFromAnchorUnit( mOffsetFromAnchorUnitWidget->unit() );
271 mCallout->setOffsetFromAnchorMapUnitScale( mOffsetFromAnchorUnitWidget->getMapUnitScale() );
275void QgsSimpleLineCalloutWidget::offsetFromAnchorChanged()
277 mCallout->setOffsetFromAnchor( mOffsetFromAnchorSpin->value() );
281void QgsSimpleLineCalloutWidget::offsetFromLabelUnitWidgetChanged()
283 mCallout->setOffsetFromLabelUnit( mOffsetFromLabelUnitWidget->unit() );
284 mCallout->setOffsetFromLabelMapUnitScale( mOffsetFromLabelUnitWidget->getMapUnitScale() );
288void QgsSimpleLineCalloutWidget::offsetFromLabelChanged()
290 mCallout->setOffsetFromLabel( mOffsetFromLabelSpin->value() );
294void QgsSimpleLineCalloutWidget::lineSymbolChanged()
296 mCallout->setLineSymbol( mCalloutLineStyleButton->clonedSymbol<
QgsLineSymbol >() );
300void QgsSimpleLineCalloutWidget::mAnchorPointComboBox_currentIndexChanged(
int index )
302 mCallout->setAnchorPoint(
static_cast<QgsCallout::AnchorPoint>( mAnchorPointComboBox->itemData( index ).toInt() ) );
306void QgsSimpleLineCalloutWidget::mLabelAnchorPointComboBox_currentIndexChanged(
int index )
312void QgsSimpleLineCalloutWidget::mCalloutBlendComboBox_currentIndexChanged(
int )
314 mCallout->setBlendMode( mCalloutBlendComboBox->blendMode() );
318void QgsSimpleLineCalloutWidget::drawToAllPartsToggled(
bool active )
320 mCallout->setDrawCalloutToAllParts( active );
329QgsManhattanLineCalloutWidget::QgsManhattanLineCalloutWidget(
QgsMapLayer *vl, QWidget *parent )
330 : QgsSimpleLineCalloutWidget( vl, parent )
340QgsCurvedLineCalloutWidget::QgsCurvedLineCalloutWidget(
QgsMapLayer *vl, QWidget *parent )
347 mCalloutLineStyleButton->setDialogTitle( tr(
"Callout Symbol" ) );
348 mCalloutLineStyleButton->registerExpressionContextGenerator(
this );
350 mCalloutLineStyleButton->setLayer( qobject_cast< QgsVectorLayer * >( vl ) );
359 connect( mMinCalloutLengthSpin,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsCurvedLineCalloutWidget::minimumLengthChanged );
362 connect( mOffsetFromAnchorSpin,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsCurvedLineCalloutWidget::offsetFromAnchorChanged );
364 connect( mOffsetFromLabelSpin,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsCurvedLineCalloutWidget::offsetFromLabelChanged );
366 connect( mDrawToAllPartsCheck, &QCheckBox::toggled,
this, &QgsCurvedLineCalloutWidget::drawToAllPartsToggled );
371 connect( mOrientationComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, [ = ](
int index )
382 connect( mAnchorPointComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsCurvedLineCalloutWidget::mAnchorPointComboBox_currentIndexChanged );
394 connect( mLabelAnchorPointComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsCurvedLineCalloutWidget::mLabelAnchorPointComboBox_currentIndexChanged );
396 connect( mCalloutLineStyleButton, &
QgsSymbolButton::changed,
this, &QgsCurvedLineCalloutWidget::lineSymbolChanged );
398 connect( mCurvatureSlider, &QSlider::valueChanged,
this, [ = ](
int value ) { mCurvatureSpinBox->setValue( value / 10.0 ); } );
399 connect( mCurvatureSpinBox,
static_cast < void (
QgsDoubleSpinBox::* )(
double )
> ( &QgsDoubleSpinBox::valueChanged ),
this, [ = ](
double value ) {
whileBlocking( mCurvatureSlider )->setValue( value * 10 ); } );
400 connect( mCurvatureSpinBox,
static_cast < void (
QgsDoubleSpinBox::* )(
double )
> ( &QgsDoubleSpinBox::valueChanged ),
this, [ = ](
double value )
402 mCallout->setCurvature( value / 100.0 );
406 connect( mCalloutBlendComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsCurvedLineCalloutWidget::mCalloutBlendComboBox_currentIndexChanged );
408 mPlacementDDGroupBox->setVisible( qobject_cast< QgsVectorLayer * >( vl ) );
411void QgsCurvedLineCalloutWidget::setCallout(
const QgsCallout *callout )
420 mMinCalloutWidthUnitWidget->blockSignals(
true );
421 mMinCalloutWidthUnitWidget->setUnit( mCallout->minimumLengthUnit() );
422 mMinCalloutWidthUnitWidget->setMapUnitScale( mCallout->minimumLengthMapUnitScale() );
423 mMinCalloutWidthUnitWidget->blockSignals(
false );
425 whileBlocking( mMinCalloutLengthSpin )->setValue( mCallout->minimumLength() );
427 mOffsetFromAnchorUnitWidget->blockSignals(
true );
428 mOffsetFromAnchorUnitWidget->setUnit( mCallout->offsetFromAnchorUnit() );
429 mOffsetFromAnchorUnitWidget->setMapUnitScale( mCallout->offsetFromAnchorMapUnitScale() );
430 mOffsetFromAnchorUnitWidget->blockSignals(
false );
431 mOffsetFromLabelUnitWidget->blockSignals(
true );
432 mOffsetFromLabelUnitWidget->setUnit( mCallout->offsetFromLabelUnit() );
433 mOffsetFromLabelUnitWidget->setMapUnitScale( mCallout->offsetFromLabelMapUnitScale() );
434 mOffsetFromLabelUnitWidget->blockSignals(
false );
435 whileBlocking( mOffsetFromAnchorSpin )->setValue( mCallout->offsetFromAnchor() );
436 whileBlocking( mOffsetFromLabelSpin )->setValue( mCallout->offsetFromLabel() );
438 whileBlocking( mCalloutLineStyleButton )->setSymbol( mCallout->lineSymbol()->clone() );
440 whileBlocking( mDrawToAllPartsCheck )->setChecked( mCallout->drawCalloutToAllParts() );
442 whileBlocking( mOrientationComboBox )->setCurrentIndex( mOrientationComboBox->findData(
static_cast< int >( mCallout->orientation() ) ) );
444 whileBlocking( mAnchorPointComboBox )->setCurrentIndex( mAnchorPointComboBox->findData(
static_cast< int >( callout->
anchorPoint() ) ) );
445 whileBlocking( mLabelAnchorPointComboBox )->setCurrentIndex( mLabelAnchorPointComboBox->findData(
static_cast< int >( callout->
labelAnchorPoint() ) ) );
447 whileBlocking( mCalloutBlendComboBox )->setBlendMode( mCallout->blendMode() );
449 whileBlocking( mCurvatureSpinBox )->setValue( mCallout->curvature() * 100.0 );
450 whileBlocking( mCurvatureSlider )->setValue( mCallout->curvature() * 1000.0 );
471 mAnchorPointLbl->setEnabled( isPolygon );
472 mAnchorPointLbl->setVisible( isPolygon );
473 mAnchorPointComboBox->setEnabled( isPolygon );
474 mAnchorPointComboBox->setVisible( isPolygon );
475 mAnchorPointDDBtn->setEnabled( isPolygon );
476 mAnchorPointDDBtn->setVisible( isPolygon );
479QgsCallout *QgsCurvedLineCalloutWidget::callout()
481 return mCallout.get();
484void QgsCurvedLineCalloutWidget::minimumLengthChanged()
486 mCallout->setMinimumLength( mMinCalloutLengthSpin->value() );
490void QgsCurvedLineCalloutWidget::minimumLengthUnitWidgetChanged()
492 mCallout->setMinimumLengthUnit( mMinCalloutWidthUnitWidget->unit() );
493 mCallout->setMinimumLengthMapUnitScale( mMinCalloutWidthUnitWidget->getMapUnitScale() );
497void QgsCurvedLineCalloutWidget::offsetFromAnchorUnitWidgetChanged()
499 mCallout->setOffsetFromAnchorUnit( mOffsetFromAnchorUnitWidget->unit() );
500 mCallout->setOffsetFromAnchorMapUnitScale( mOffsetFromAnchorUnitWidget->getMapUnitScale() );
504void QgsCurvedLineCalloutWidget::offsetFromAnchorChanged()
506 mCallout->setOffsetFromAnchor( mOffsetFromAnchorSpin->value() );
510void QgsCurvedLineCalloutWidget::offsetFromLabelUnitWidgetChanged()
512 mCallout->setOffsetFromLabelUnit( mOffsetFromLabelUnitWidget->unit() );
513 mCallout->setOffsetFromLabelMapUnitScale( mOffsetFromLabelUnitWidget->getMapUnitScale() );
517void QgsCurvedLineCalloutWidget::offsetFromLabelChanged()
519 mCallout->setOffsetFromLabel( mOffsetFromLabelSpin->value() );
523void QgsCurvedLineCalloutWidget::lineSymbolChanged()
525 mCallout->setLineSymbol( mCalloutLineStyleButton->clonedSymbol<
QgsLineSymbol >() );
529void QgsCurvedLineCalloutWidget::mAnchorPointComboBox_currentIndexChanged(
int index )
531 mCallout->setAnchorPoint(
static_cast<QgsCallout::AnchorPoint>( mAnchorPointComboBox->itemData( index ).toInt() ) );
535void QgsCurvedLineCalloutWidget::mLabelAnchorPointComboBox_currentIndexChanged(
int index )
541void QgsCurvedLineCalloutWidget::mCalloutBlendComboBox_currentIndexChanged(
int )
543 mCallout->setBlendMode( mCalloutBlendComboBox->blendMode() );
547void QgsCurvedLineCalloutWidget::drawToAllPartsToggled(
bool active )
549 mCallout->setDrawCalloutToAllParts( active );
558QgsBalloonCalloutWidget::QgsBalloonCalloutWidget(
QgsMapLayer *vl, QWidget *parent )
565 mCalloutFillStyleButton->setDialogTitle( tr(
"Balloon Symbol" ) );
566 mCalloutFillStyleButton->registerExpressionContextGenerator(
this );
568 mCalloutFillStyleButton->setLayer( qobject_cast< QgsVectorLayer * >( vl ) );
578 mSpinBottomMargin->setClearValue( 0 );
579 mSpinTopMargin->setClearValue( 0 );
580 mSpinRightMargin->setClearValue( 0 );
581 mSpinLeftMargin->setClearValue( 0 );
582 mWedgeWidthSpin->setClearValue( 2.64 );
583 mCornerRadiusSpin->setClearValue( 0.0 );
586 connect( mOffsetFromAnchorSpin,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsBalloonCalloutWidget::offsetFromAnchorChanged );
593 connect( mAnchorPointComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsBalloonCalloutWidget::mAnchorPointComboBox_currentIndexChanged );
597 connect( mSpinBottomMargin, qOverload< double >( &QDoubleSpinBox::valueChanged ),
this, [ = ](
double value )
601 mCallout->setMargins( margins );
604 connect( mSpinTopMargin, qOverload< double >( &QDoubleSpinBox::valueChanged ),
this, [ = ](
double value )
608 mCallout->setMargins( margins );
611 connect( mSpinLeftMargin, qOverload< double >( &QDoubleSpinBox::valueChanged ),
this, [ = ](
double value )
615 mCallout->setMargins( margins );
618 connect( mSpinRightMargin, qOverload< double >( &QDoubleSpinBox::valueChanged ),
this, [ = ](
double value )
622 mCallout->setMargins( margins );
627 mCallout->setMarginsUnit( mMarginUnitWidget->unit() );
633 mCallout->setWedgeWidthUnit( mWedgeWidthUnitWidget->unit() );
634 mCallout->setWedgeWidthMapUnitScale( mWedgeWidthUnitWidget->getMapUnitScale() );
637 connect( mWedgeWidthSpin, qOverload< double >( &QDoubleSpinBox::valueChanged ),
this, [ = ](
double value )
639 mCallout->setWedgeWidth( value );
645 mCallout->setCornerRadiusUnit( mCornerRadiusUnitWidget->unit() );
646 mCallout->setCornerRadiusMapUnitScale( mCornerRadiusUnitWidget->getMapUnitScale() );
649 connect( mCornerRadiusSpin, qOverload< double >( &QDoubleSpinBox::valueChanged ),
this, [ = ](
double value )
651 mCallout->setCornerRadius( value );
655 connect( mCalloutBlendComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsBalloonCalloutWidget::mCalloutBlendComboBox_currentIndexChanged );
657 mPlacementDDGroupBox->setVisible( qobject_cast< QgsVectorLayer * >( vl ) );
660void QgsBalloonCalloutWidget::setCallout(
const QgsCallout *callout )
669 mOffsetFromAnchorUnitWidget->blockSignals(
true );
670 mOffsetFromAnchorUnitWidget->setUnit( mCallout->offsetFromAnchorUnit() );
671 mOffsetFromAnchorUnitWidget->setMapUnitScale( mCallout->offsetFromAnchorMapUnitScale() );
672 mOffsetFromAnchorUnitWidget->blockSignals(
false );
673 whileBlocking( mOffsetFromAnchorSpin )->setValue( mCallout->offsetFromAnchor() );
675 whileBlocking( mSpinBottomMargin )->setValue( mCallout->margins().bottom() );
676 whileBlocking( mSpinTopMargin )->setValue( mCallout->margins().top() );
677 whileBlocking( mSpinLeftMargin )->setValue( mCallout->margins().left() );
678 whileBlocking( mSpinRightMargin )->setValue( mCallout->margins().right() );
679 whileBlocking( mMarginUnitWidget )->setUnit( mCallout->marginsUnit() );
681 mWedgeWidthUnitWidget->blockSignals(
true );
682 mWedgeWidthUnitWidget->setUnit( mCallout->wedgeWidthUnit() );
683 mWedgeWidthUnitWidget->setMapUnitScale( mCallout->wedgeWidthMapUnitScale() );
684 mWedgeWidthUnitWidget->blockSignals(
false );
685 whileBlocking( mWedgeWidthSpin )->setValue( mCallout->wedgeWidth() );
687 mCornerRadiusUnitWidget->blockSignals(
true );
688 mCornerRadiusUnitWidget->setUnit( mCallout->cornerRadiusUnit() );
689 mCornerRadiusUnitWidget->setMapUnitScale( mCallout->cornerRadiusMapUnitScale() );
690 mCornerRadiusUnitWidget->blockSignals(
false );
691 whileBlocking( mCornerRadiusSpin )->setValue( mCallout->cornerRadius() );
693 whileBlocking( mCalloutFillStyleButton )->setSymbol( mCallout->fillSymbol()->clone() );
695 whileBlocking( mAnchorPointComboBox )->setCurrentIndex( mAnchorPointComboBox->findData(
static_cast< int >( callout->
anchorPoint() ) ) );
697 whileBlocking( mCalloutBlendComboBox )->setBlendMode( mCallout->blendMode() );
713 mAnchorPointLbl->setEnabled( isPolygon );
714 mAnchorPointLbl->setVisible( isPolygon );
715 mAnchorPointComboBox->setEnabled( isPolygon );
716 mAnchorPointComboBox->setVisible( isPolygon );
717 mAnchorPointDDBtn->setEnabled( isPolygon );
718 mAnchorPointDDBtn->setVisible( isPolygon );
723 return mCallout.get();
726void QgsBalloonCalloutWidget::offsetFromAnchorUnitWidgetChanged()
728 mCallout->setOffsetFromAnchorUnit( mOffsetFromAnchorUnitWidget->unit() );
729 mCallout->setOffsetFromAnchorMapUnitScale( mOffsetFromAnchorUnitWidget->getMapUnitScale() );
733void QgsBalloonCalloutWidget::offsetFromAnchorChanged()
735 mCallout->setOffsetFromAnchor( mOffsetFromAnchorSpin->value() );
739void QgsBalloonCalloutWidget::fillSymbolChanged()
741 mCallout->setFillSymbol( mCalloutFillStyleButton->clonedSymbol<
QgsFillSymbol >() );
745void QgsBalloonCalloutWidget::mAnchorPointComboBox_currentIndexChanged(
int index )
747 mCallout->setAnchorPoint(
static_cast<QgsCallout::AnchorPoint>( mAnchorPointComboBox->itemData( index ).toInt() ) );
751void QgsBalloonCalloutWidget::mCalloutBlendComboBox_currentIndexChanged(
int )
753 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.
@ MinimumCalloutLength
Minimum length of callouts.
@ LabelAnchorPointPosition
Label's anchor point position.
@ CornerRadius
Balloon callout corner radius (since QGIS 3.20)
@ OffsetFromAnchor
Distance to offset lines from anchor points.
@ OffsetFromLabel
Distance to offset lines from label area.
@ DestinationX
X-coordinate of callout destination (feature anchor) (since QGIS 3.20)
@ DestinationY
Y-coordinate of callout destination (feature anchor) (since QGIS 3.20)
@ WedgeWidth
Balloon callout wedge width (since QGIS 3.20)
@ AnchorPointPosition
Feature's anchor point position.
@ OriginX
X-coordinate of callout origin (label anchor) (since QGIS 3.20)
@ OriginY
Y-coordinate of callout origin (label anchor) (since QGIS 3.20)
@ Curvature
Curvature of curved line callouts (since QGIS 3.20)
@ BlendMode
Callout blend mode (since QGIS 3.20)
@ Orientation
Orientation of curved line callouts (since QGIS 3.20)
@ Margins
Margin from text (since QGIS 3.20)
@ DrawCalloutToAllParts
Whether callout lines should be drawn to all feature parts.
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.
Base class for all map layer types.
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.