31 return *lExpressionContext;
36 expContext << symbolScope;
56 const auto unitSelectionWidgets = findChildren<QgsUnitSelectionWidget *>();
59 unitWidget->setMapCanvas( mContext.
mapCanvas() );
61 const auto symbolButtonWidgets = findChildren<QgsSymbolButton *>();
64 symbolWidget->setMapCanvas( mContext.
mapCanvas() );
65 symbolWidget->setMessageBar( mContext.
messageBar() );
83void QgsCalloutWidget::createAuxiliaryField()
113 property.setActive(
true );
122void QgsCalloutWidget::updateDataDefinedProperty()
136QgsSimpleLineCalloutWidget::QgsSimpleLineCalloutWidget(
QgsMapLayer *vl, QWidget *parent )
143 mCalloutLineStyleButton->setDialogTitle( tr(
"Callout Symbol" ) );
144 mCalloutLineStyleButton->registerExpressionContextGenerator(
this );
146 mCalloutLineStyleButton->setLayer( qobject_cast< QgsVectorLayer * >( vl ) );
155 connect( mMinCalloutLengthSpin,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleLineCalloutWidget::minimumLengthChanged );
158 connect( mOffsetFromAnchorSpin,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleLineCalloutWidget::offsetFromAnchorChanged );
160 connect( mOffsetFromLabelSpin,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleLineCalloutWidget::offsetFromLabelChanged );
162 connect( mDrawToAllPartsCheck, &QCheckBox::toggled,
this, &QgsSimpleLineCalloutWidget::drawToAllPartsToggled );
169 connect( mAnchorPointComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleLineCalloutWidget::mAnchorPointComboBox_currentIndexChanged );
181 connect( mLabelAnchorPointComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleLineCalloutWidget::mLabelAnchorPointComboBox_currentIndexChanged );
183 connect( mCalloutLineStyleButton, &
QgsSymbolButton::changed,
this, &QgsSimpleLineCalloutWidget::lineSymbolChanged );
185 connect( mCalloutBlendComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleLineCalloutWidget::mCalloutBlendComboBox_currentIndexChanged );
187 mPlacementDDGroupBox->setVisible( qobject_cast< QgsVectorLayer * >( vl ) );
190void QgsSimpleLineCalloutWidget::setCallout(
const QgsCallout *callout )
199 mMinCalloutWidthUnitWidget->blockSignals(
true );
200 mMinCalloutWidthUnitWidget->setUnit( mCallout->minimumLengthUnit() );
201 mMinCalloutWidthUnitWidget->setMapUnitScale( mCallout->minimumLengthMapUnitScale() );
202 mMinCalloutWidthUnitWidget->blockSignals(
false );
204 whileBlocking( mMinCalloutLengthSpin )->setValue( mCallout->minimumLength() );
206 mOffsetFromAnchorUnitWidget->blockSignals(
true );
207 mOffsetFromAnchorUnitWidget->setUnit( mCallout->offsetFromAnchorUnit() );
208 mOffsetFromAnchorUnitWidget->setMapUnitScale( mCallout->offsetFromAnchorMapUnitScale() );
209 mOffsetFromAnchorUnitWidget->blockSignals(
false );
210 mOffsetFromLabelUnitWidget->blockSignals(
true );
211 mOffsetFromLabelUnitWidget->setUnit( mCallout->offsetFromLabelUnit() );
212 mOffsetFromLabelUnitWidget->setMapUnitScale( mCallout->offsetFromLabelMapUnitScale() );
213 mOffsetFromLabelUnitWidget->blockSignals(
false );
214 whileBlocking( mOffsetFromAnchorSpin )->setValue( mCallout->offsetFromAnchor() );
215 whileBlocking( mOffsetFromLabelSpin )->setValue( mCallout->offsetFromLabel() );
217 whileBlocking( mCalloutLineStyleButton )->setSymbol( mCallout->lineSymbol()->clone() );
219 whileBlocking( mDrawToAllPartsCheck )->setChecked( mCallout->drawCalloutToAllParts() );
221 whileBlocking( mAnchorPointComboBox )->setCurrentIndex( mAnchorPointComboBox->findData(
static_cast< int >( callout->
anchorPoint() ) ) );
222 whileBlocking( mLabelAnchorPointComboBox )->setCurrentIndex( mLabelAnchorPointComboBox->findData(
static_cast< int >( callout->
labelAnchorPoint() ) ) );
224 whileBlocking( mCalloutBlendComboBox )->setBlendMode( mCallout->blendMode() );
243 mAnchorPointLbl->setEnabled( isPolygon );
244 mAnchorPointLbl->setVisible( isPolygon );
245 mAnchorPointComboBox->setEnabled( isPolygon );
246 mAnchorPointComboBox->setVisible( isPolygon );
247 mAnchorPointDDBtn->setEnabled( isPolygon );
248 mAnchorPointDDBtn->setVisible( isPolygon );
251QgsCallout *QgsSimpleLineCalloutWidget::callout()
253 return mCallout.get();
256void QgsSimpleLineCalloutWidget::minimumLengthChanged()
258 mCallout->setMinimumLength( mMinCalloutLengthSpin->value() );
262void QgsSimpleLineCalloutWidget::minimumLengthUnitWidgetChanged()
264 mCallout->setMinimumLengthUnit( mMinCalloutWidthUnitWidget->unit() );
265 mCallout->setMinimumLengthMapUnitScale( mMinCalloutWidthUnitWidget->getMapUnitScale() );
269void QgsSimpleLineCalloutWidget::offsetFromAnchorUnitWidgetChanged()
271 mCallout->setOffsetFromAnchorUnit( mOffsetFromAnchorUnitWidget->unit() );
272 mCallout->setOffsetFromAnchorMapUnitScale( mOffsetFromAnchorUnitWidget->getMapUnitScale() );
276void QgsSimpleLineCalloutWidget::offsetFromAnchorChanged()
278 mCallout->setOffsetFromAnchor( mOffsetFromAnchorSpin->value() );
282void QgsSimpleLineCalloutWidget::offsetFromLabelUnitWidgetChanged()
284 mCallout->setOffsetFromLabelUnit( mOffsetFromLabelUnitWidget->unit() );
285 mCallout->setOffsetFromLabelMapUnitScale( mOffsetFromLabelUnitWidget->getMapUnitScale() );
289void QgsSimpleLineCalloutWidget::offsetFromLabelChanged()
291 mCallout->setOffsetFromLabel( mOffsetFromLabelSpin->value() );
295void QgsSimpleLineCalloutWidget::lineSymbolChanged()
297 mCallout->setLineSymbol( mCalloutLineStyleButton->clonedSymbol<
QgsLineSymbol >() );
301void QgsSimpleLineCalloutWidget::mAnchorPointComboBox_currentIndexChanged(
int index )
303 mCallout->setAnchorPoint(
static_cast<QgsCallout::AnchorPoint>( mAnchorPointComboBox->itemData( index ).toInt() ) );
307void QgsSimpleLineCalloutWidget::mLabelAnchorPointComboBox_currentIndexChanged(
int index )
313void QgsSimpleLineCalloutWidget::mCalloutBlendComboBox_currentIndexChanged(
int )
315 mCallout->setBlendMode( mCalloutBlendComboBox->blendMode() );
319void QgsSimpleLineCalloutWidget::drawToAllPartsToggled(
bool active )
321 mCallout->setDrawCalloutToAllParts( active );
330QgsManhattanLineCalloutWidget::QgsManhattanLineCalloutWidget(
QgsMapLayer *vl, QWidget *parent )
331 : QgsSimpleLineCalloutWidget( vl, parent )
341QgsCurvedLineCalloutWidget::QgsCurvedLineCalloutWidget(
QgsMapLayer *vl, QWidget *parent )
348 mCalloutLineStyleButton->setDialogTitle( tr(
"Callout Symbol" ) );
349 mCalloutLineStyleButton->registerExpressionContextGenerator(
this );
351 mCalloutLineStyleButton->setLayer( qobject_cast< QgsVectorLayer * >( vl ) );
360 connect( mMinCalloutLengthSpin,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsCurvedLineCalloutWidget::minimumLengthChanged );
363 connect( mOffsetFromAnchorSpin,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsCurvedLineCalloutWidget::offsetFromAnchorChanged );
365 connect( mOffsetFromLabelSpin,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsCurvedLineCalloutWidget::offsetFromLabelChanged );
367 connect( mDrawToAllPartsCheck, &QCheckBox::toggled,
this, &QgsCurvedLineCalloutWidget::drawToAllPartsToggled );
372 connect( mOrientationComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, [ = ](
int index )
383 connect( mAnchorPointComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsCurvedLineCalloutWidget::mAnchorPointComboBox_currentIndexChanged );
395 connect( mLabelAnchorPointComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsCurvedLineCalloutWidget::mLabelAnchorPointComboBox_currentIndexChanged );
397 connect( mCalloutLineStyleButton, &
QgsSymbolButton::changed,
this, &QgsCurvedLineCalloutWidget::lineSymbolChanged );
399 connect( mCurvatureSlider, &QSlider::valueChanged,
this, [ = ](
int value ) { mCurvatureSpinBox->setValue( value / 10.0 ); } );
400 connect( mCurvatureSpinBox,
static_cast < void (
QgsDoubleSpinBox::* )(
double )
> ( &QgsDoubleSpinBox::valueChanged ),
this, [ = ](
double value ) {
whileBlocking( mCurvatureSlider )->setValue( value * 10 ); } );
401 connect( mCurvatureSpinBox,
static_cast < void (
QgsDoubleSpinBox::* )(
double )
> ( &QgsDoubleSpinBox::valueChanged ),
this, [ = ](
double value )
403 mCallout->setCurvature( value / 100.0 );
407 connect( mCalloutBlendComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsCurvedLineCalloutWidget::mCalloutBlendComboBox_currentIndexChanged );
409 mPlacementDDGroupBox->setVisible( qobject_cast< QgsVectorLayer * >( vl ) );
412void QgsCurvedLineCalloutWidget::setCallout(
const QgsCallout *callout )
421 mMinCalloutWidthUnitWidget->blockSignals(
true );
422 mMinCalloutWidthUnitWidget->setUnit( mCallout->minimumLengthUnit() );
423 mMinCalloutWidthUnitWidget->setMapUnitScale( mCallout->minimumLengthMapUnitScale() );
424 mMinCalloutWidthUnitWidget->blockSignals(
false );
426 whileBlocking( mMinCalloutLengthSpin )->setValue( mCallout->minimumLength() );
428 mOffsetFromAnchorUnitWidget->blockSignals(
true );
429 mOffsetFromAnchorUnitWidget->setUnit( mCallout->offsetFromAnchorUnit() );
430 mOffsetFromAnchorUnitWidget->setMapUnitScale( mCallout->offsetFromAnchorMapUnitScale() );
431 mOffsetFromAnchorUnitWidget->blockSignals(
false );
432 mOffsetFromLabelUnitWidget->blockSignals(
true );
433 mOffsetFromLabelUnitWidget->setUnit( mCallout->offsetFromLabelUnit() );
434 mOffsetFromLabelUnitWidget->setMapUnitScale( mCallout->offsetFromLabelMapUnitScale() );
435 mOffsetFromLabelUnitWidget->blockSignals(
false );
436 whileBlocking( mOffsetFromAnchorSpin )->setValue( mCallout->offsetFromAnchor() );
437 whileBlocking( mOffsetFromLabelSpin )->setValue( mCallout->offsetFromLabel() );
439 whileBlocking( mCalloutLineStyleButton )->setSymbol( mCallout->lineSymbol()->clone() );
441 whileBlocking( mDrawToAllPartsCheck )->setChecked( mCallout->drawCalloutToAllParts() );
443 whileBlocking( mOrientationComboBox )->setCurrentIndex( mOrientationComboBox->findData(
static_cast< int >( mCallout->orientation() ) ) );
445 whileBlocking( mAnchorPointComboBox )->setCurrentIndex( mAnchorPointComboBox->findData(
static_cast< int >( callout->
anchorPoint() ) ) );
446 whileBlocking( mLabelAnchorPointComboBox )->setCurrentIndex( mLabelAnchorPointComboBox->findData(
static_cast< int >( callout->
labelAnchorPoint() ) ) );
448 whileBlocking( mCalloutBlendComboBox )->setBlendMode( mCallout->blendMode() );
450 whileBlocking( mCurvatureSpinBox )->setValue( mCallout->curvature() * 100.0 );
451 whileBlocking( mCurvatureSlider )->setValue( mCallout->curvature() * 1000.0 );
472 mAnchorPointLbl->setEnabled( isPolygon );
473 mAnchorPointLbl->setVisible( isPolygon );
474 mAnchorPointComboBox->setEnabled( isPolygon );
475 mAnchorPointComboBox->setVisible( isPolygon );
476 mAnchorPointDDBtn->setEnabled( isPolygon );
477 mAnchorPointDDBtn->setVisible( isPolygon );
480QgsCallout *QgsCurvedLineCalloutWidget::callout()
482 return mCallout.get();
485void QgsCurvedLineCalloutWidget::minimumLengthChanged()
487 mCallout->setMinimumLength( mMinCalloutLengthSpin->value() );
491void QgsCurvedLineCalloutWidget::minimumLengthUnitWidgetChanged()
493 mCallout->setMinimumLengthUnit( mMinCalloutWidthUnitWidget->unit() );
494 mCallout->setMinimumLengthMapUnitScale( mMinCalloutWidthUnitWidget->getMapUnitScale() );
498void QgsCurvedLineCalloutWidget::offsetFromAnchorUnitWidgetChanged()
500 mCallout->setOffsetFromAnchorUnit( mOffsetFromAnchorUnitWidget->unit() );
501 mCallout->setOffsetFromAnchorMapUnitScale( mOffsetFromAnchorUnitWidget->getMapUnitScale() );
505void QgsCurvedLineCalloutWidget::offsetFromAnchorChanged()
507 mCallout->setOffsetFromAnchor( mOffsetFromAnchorSpin->value() );
511void QgsCurvedLineCalloutWidget::offsetFromLabelUnitWidgetChanged()
513 mCallout->setOffsetFromLabelUnit( mOffsetFromLabelUnitWidget->unit() );
514 mCallout->setOffsetFromLabelMapUnitScale( mOffsetFromLabelUnitWidget->getMapUnitScale() );
518void QgsCurvedLineCalloutWidget::offsetFromLabelChanged()
520 mCallout->setOffsetFromLabel( mOffsetFromLabelSpin->value() );
524void QgsCurvedLineCalloutWidget::lineSymbolChanged()
526 mCallout->setLineSymbol( mCalloutLineStyleButton->clonedSymbol<
QgsLineSymbol >() );
530void QgsCurvedLineCalloutWidget::mAnchorPointComboBox_currentIndexChanged(
int index )
532 mCallout->setAnchorPoint(
static_cast<QgsCallout::AnchorPoint>( mAnchorPointComboBox->itemData( index ).toInt() ) );
536void QgsCurvedLineCalloutWidget::mLabelAnchorPointComboBox_currentIndexChanged(
int index )
542void QgsCurvedLineCalloutWidget::mCalloutBlendComboBox_currentIndexChanged(
int )
544 mCallout->setBlendMode( mCalloutBlendComboBox->blendMode() );
548void QgsCurvedLineCalloutWidget::drawToAllPartsToggled(
bool active )
550 mCallout->setDrawCalloutToAllParts( active );
559QgsBalloonCalloutWidget::QgsBalloonCalloutWidget(
QgsMapLayer *vl, QWidget *parent )
566 mCalloutFillStyleButton->setDialogTitle( tr(
"Balloon Symbol" ) );
567 mCalloutFillStyleButton->registerExpressionContextGenerator(
this );
570 mMarkerSymbolButton->setDialogTitle( tr(
"Marker Symbol" ) );
571 mMarkerSymbolButton->registerExpressionContextGenerator(
this );
572 mMarkerSymbolButton->setShowNull(
true );
573 mMarkerSymbolButton->setToNull();
575 mCalloutFillStyleButton->setLayer( qobject_cast< QgsVectorLayer * >( vl ) );
576 mMarkerSymbolButton->setLayer( qobject_cast< QgsVectorLayer * >( vl ) );
586 mSpinBottomMargin->setClearValue( 0 );
587 mSpinTopMargin->setClearValue( 0 );
588 mSpinRightMargin->setClearValue( 0 );
589 mSpinLeftMargin->setClearValue( 0 );
590 mWedgeWidthSpin->setClearValue( 2.64 );
591 mCornerRadiusSpin->setClearValue( 0.0 );
594 connect( mOffsetFromAnchorSpin,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsBalloonCalloutWidget::offsetFromAnchorChanged );
601 connect( mAnchorPointComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsBalloonCalloutWidget::mAnchorPointComboBox_currentIndexChanged );
606 connect( mSpinBottomMargin, qOverload< double >( &QDoubleSpinBox::valueChanged ),
this, [ = ](
double value )
610 mCallout->setMargins( margins );
613 connect( mSpinTopMargin, qOverload< double >( &QDoubleSpinBox::valueChanged ),
this, [ = ](
double value )
617 mCallout->setMargins( margins );
620 connect( mSpinLeftMargin, qOverload< double >( &QDoubleSpinBox::valueChanged ),
this, [ = ](
double value )
624 mCallout->setMargins( margins );
627 connect( mSpinRightMargin, qOverload< double >( &QDoubleSpinBox::valueChanged ),
this, [ = ](
double value )
631 mCallout->setMargins( margins );
636 mCallout->setMarginsUnit( mMarginUnitWidget->unit() );
642 mCallout->setWedgeWidthUnit( mWedgeWidthUnitWidget->unit() );
643 mCallout->setWedgeWidthMapUnitScale( mWedgeWidthUnitWidget->getMapUnitScale() );
646 connect( mWedgeWidthSpin, qOverload< double >( &QDoubleSpinBox::valueChanged ),
this, [ = ](
double value )
648 mCallout->setWedgeWidth( value );
654 mCallout->setCornerRadiusUnit( mCornerRadiusUnitWidget->unit() );
655 mCallout->setCornerRadiusMapUnitScale( mCornerRadiusUnitWidget->getMapUnitScale() );
658 connect( mCornerRadiusSpin, qOverload< double >( &QDoubleSpinBox::valueChanged ),
this, [ = ](
double value )
660 mCallout->setCornerRadius( value );
664 connect( mCalloutBlendComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsBalloonCalloutWidget::mCalloutBlendComboBox_currentIndexChanged );
666 mPlacementDDGroupBox->setVisible( qobject_cast< QgsVectorLayer * >( vl ) );
669void QgsBalloonCalloutWidget::setCallout(
const QgsCallout *callout )
678 mOffsetFromAnchorUnitWidget->blockSignals(
true );
679 mOffsetFromAnchorUnitWidget->setUnit( mCallout->offsetFromAnchorUnit() );
680 mOffsetFromAnchorUnitWidget->setMapUnitScale( mCallout->offsetFromAnchorMapUnitScale() );
681 mOffsetFromAnchorUnitWidget->blockSignals(
false );
682 whileBlocking( mOffsetFromAnchorSpin )->setValue( mCallout->offsetFromAnchor() );
684 whileBlocking( mSpinBottomMargin )->setValue( mCallout->margins().bottom() );
685 whileBlocking( mSpinTopMargin )->setValue( mCallout->margins().top() );
686 whileBlocking( mSpinLeftMargin )->setValue( mCallout->margins().left() );
687 whileBlocking( mSpinRightMargin )->setValue( mCallout->margins().right() );
688 whileBlocking( mMarginUnitWidget )->setUnit( mCallout->marginsUnit() );
690 mWedgeWidthUnitWidget->blockSignals(
true );
691 mWedgeWidthUnitWidget->setUnit( mCallout->wedgeWidthUnit() );
692 mWedgeWidthUnitWidget->setMapUnitScale( mCallout->wedgeWidthMapUnitScale() );
693 mWedgeWidthUnitWidget->blockSignals(
false );
694 whileBlocking( mWedgeWidthSpin )->setValue( mCallout->wedgeWidth() );
696 mCornerRadiusUnitWidget->blockSignals(
true );
697 mCornerRadiusUnitWidget->setUnit( mCallout->cornerRadiusUnit() );
698 mCornerRadiusUnitWidget->setMapUnitScale( mCallout->cornerRadiusMapUnitScale() );
699 mCornerRadiusUnitWidget->blockSignals(
false );
700 whileBlocking( mCornerRadiusSpin )->setValue( mCallout->cornerRadius() );
702 whileBlocking( mCalloutFillStyleButton )->setSymbol( mCallout->fillSymbol()->clone() );
704 whileBlocking( mMarkerSymbolButton )->setSymbol( marker->clone() );
708 whileBlocking( mAnchorPointComboBox )->setCurrentIndex( mAnchorPointComboBox->findData(
static_cast< int >( callout->
anchorPoint() ) ) );
710 whileBlocking( mCalloutBlendComboBox )->setBlendMode( mCallout->blendMode() );
726 mAnchorPointLbl->setEnabled( isPolygon );
727 mAnchorPointLbl->setVisible( isPolygon );
728 mAnchorPointComboBox->setEnabled( isPolygon );
729 mAnchorPointComboBox->setVisible( isPolygon );
730 mAnchorPointDDBtn->setEnabled( isPolygon );
731 mAnchorPointDDBtn->setVisible( isPolygon );
736 return mCallout.get();
739void QgsBalloonCalloutWidget::offsetFromAnchorUnitWidgetChanged()
741 mCallout->setOffsetFromAnchorUnit( mOffsetFromAnchorUnitWidget->unit() );
742 mCallout->setOffsetFromAnchorMapUnitScale( mOffsetFromAnchorUnitWidget->getMapUnitScale() );
746void QgsBalloonCalloutWidget::offsetFromAnchorChanged()
748 mCallout->setOffsetFromAnchor( mOffsetFromAnchorSpin->value() );
752void QgsBalloonCalloutWidget::fillSymbolChanged()
754 mCallout->setFillSymbol( mCalloutFillStyleButton->clonedSymbol<
QgsFillSymbol >() );
758void QgsBalloonCalloutWidget::markerSymbolChanged()
760 mCallout->setMarkerSymbol( mMarkerSymbolButton->isNull() ?
nullptr : mMarkerSymbolButton->clonedSymbol<
QgsMarkerSymbol >() );
764void QgsBalloonCalloutWidget::mAnchorPointComboBox_currentIndexChanged(
int index )
766 mCallout->setAnchorPoint(
static_cast<QgsCallout::AnchorPoint>( mAnchorPointComboBox->itemData( index ).toInt() ) );
770void QgsBalloonCalloutWidget::mCalloutBlendComboBox_currentIndexChanged(
int )
772 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.
@ OffsetFromAnchor
Distance to offset lines from anchor points.
@ OffsetFromLabel
Distance to offset lines from label area.
@ DestinationX
X-coordinate of callout destination (feature anchor)
@ DestinationY
Y-coordinate of callout destination (feature anchor)
@ WedgeWidth
Balloon callout wedge width.
@ AnchorPointPosition
Feature's anchor point position.
@ OriginX
X-coordinate of callout origin (label anchor)
@ OriginY
Y-coordinate of callout origin (label anchor)
@ Curvature
Curvature of curved line callouts.
@ BlendMode
Callout blend mode.
@ Orientation
Orientation of curved line callouts.
@ Margins
Margin from text.
@ 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 marker symbol type, for rendering Point and MultiPoint geometries.
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.