17#include "moc_qgscalloutwidget.cpp"
32 return *lExpressionContext;
37 expContext << symbolScope;
57 const auto unitSelectionWidgets = findChildren<QgsUnitSelectionWidget *>();
60 unitWidget->setMapCanvas( mContext.
mapCanvas() );
62 const auto symbolButtonWidgets = findChildren<QgsSymbolButton *>();
65 symbolWidget->setMapCanvas( mContext.
mapCanvas() );
66 symbolWidget->setMessageBar( mContext.
messageBar() );
84void QgsCalloutWidget::createAuxiliaryField()
114 property.setActive(
true );
123void QgsCalloutWidget::updateDataDefinedProperty()
137QgsSimpleLineCalloutWidget::QgsSimpleLineCalloutWidget(
QgsMapLayer *vl, QWidget *parent )
144 mCalloutLineStyleButton->setDialogTitle( tr(
"Callout Symbol" ) );
145 mCalloutLineStyleButton->registerExpressionContextGenerator(
this );
147 mCalloutLineStyleButton->setLayer( qobject_cast< QgsVectorLayer * >( vl ) );
156 connect( mMinCalloutLengthSpin,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleLineCalloutWidget::minimumLengthChanged );
159 connect( mOffsetFromAnchorSpin,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleLineCalloutWidget::offsetFromAnchorChanged );
161 connect( mOffsetFromLabelSpin,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleLineCalloutWidget::offsetFromLabelChanged );
163 connect( mDrawToAllPartsCheck, &QCheckBox::toggled,
this, &QgsSimpleLineCalloutWidget::drawToAllPartsToggled );
170 connect( mAnchorPointComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleLineCalloutWidget::mAnchorPointComboBox_currentIndexChanged );
182 connect( mLabelAnchorPointComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleLineCalloutWidget::mLabelAnchorPointComboBox_currentIndexChanged );
184 connect( mCalloutLineStyleButton, &
QgsSymbolButton::changed,
this, &QgsSimpleLineCalloutWidget::lineSymbolChanged );
186 connect( mCalloutBlendComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleLineCalloutWidget::mCalloutBlendComboBox_currentIndexChanged );
188 mPlacementDDGroupBox->setVisible( qobject_cast< QgsVectorLayer * >( vl ) );
191void QgsSimpleLineCalloutWidget::setCallout(
const QgsCallout *callout )
200 mMinCalloutWidthUnitWidget->blockSignals(
true );
201 mMinCalloutWidthUnitWidget->setUnit( mCallout->minimumLengthUnit() );
202 mMinCalloutWidthUnitWidget->setMapUnitScale( mCallout->minimumLengthMapUnitScale() );
203 mMinCalloutWidthUnitWidget->blockSignals(
false );
205 whileBlocking( mMinCalloutLengthSpin )->setValue( mCallout->minimumLength() );
207 mOffsetFromAnchorUnitWidget->blockSignals(
true );
208 mOffsetFromAnchorUnitWidget->setUnit( mCallout->offsetFromAnchorUnit() );
209 mOffsetFromAnchorUnitWidget->setMapUnitScale( mCallout->offsetFromAnchorMapUnitScale() );
210 mOffsetFromAnchorUnitWidget->blockSignals(
false );
211 mOffsetFromLabelUnitWidget->blockSignals(
true );
212 mOffsetFromLabelUnitWidget->setUnit( mCallout->offsetFromLabelUnit() );
213 mOffsetFromLabelUnitWidget->setMapUnitScale( mCallout->offsetFromLabelMapUnitScale() );
214 mOffsetFromLabelUnitWidget->blockSignals(
false );
215 whileBlocking( mOffsetFromAnchorSpin )->setValue( mCallout->offsetFromAnchor() );
216 whileBlocking( mOffsetFromLabelSpin )->setValue( mCallout->offsetFromLabel() );
218 whileBlocking( mCalloutLineStyleButton )->setSymbol( mCallout->lineSymbol()->clone() );
220 whileBlocking( mDrawToAllPartsCheck )->setChecked( mCallout->drawCalloutToAllParts() );
222 whileBlocking( mAnchorPointComboBox )->setCurrentIndex( mAnchorPointComboBox->findData(
static_cast< int >( callout->
anchorPoint() ) ) );
223 whileBlocking( mLabelAnchorPointComboBox )->setCurrentIndex( mLabelAnchorPointComboBox->findData(
static_cast< int >( callout->
labelAnchorPoint() ) ) );
225 whileBlocking( mCalloutBlendComboBox )->setBlendMode( mCallout->blendMode() );
244 mAnchorPointLbl->setEnabled( isPolygon );
245 mAnchorPointLbl->setVisible( isPolygon );
246 mAnchorPointComboBox->setEnabled( isPolygon );
247 mAnchorPointComboBox->setVisible( isPolygon );
248 mAnchorPointDDBtn->setEnabled( isPolygon );
249 mAnchorPointDDBtn->setVisible( isPolygon );
252QgsCallout *QgsSimpleLineCalloutWidget::callout()
254 return mCallout.get();
257void QgsSimpleLineCalloutWidget::minimumLengthChanged()
259 mCallout->setMinimumLength( mMinCalloutLengthSpin->value() );
263void QgsSimpleLineCalloutWidget::minimumLengthUnitWidgetChanged()
265 mCallout->setMinimumLengthUnit( mMinCalloutWidthUnitWidget->unit() );
266 mCallout->setMinimumLengthMapUnitScale( mMinCalloutWidthUnitWidget->getMapUnitScale() );
270void QgsSimpleLineCalloutWidget::offsetFromAnchorUnitWidgetChanged()
272 mCallout->setOffsetFromAnchorUnit( mOffsetFromAnchorUnitWidget->unit() );
273 mCallout->setOffsetFromAnchorMapUnitScale( mOffsetFromAnchorUnitWidget->getMapUnitScale() );
277void QgsSimpleLineCalloutWidget::offsetFromAnchorChanged()
279 mCallout->setOffsetFromAnchor( mOffsetFromAnchorSpin->value() );
283void QgsSimpleLineCalloutWidget::offsetFromLabelUnitWidgetChanged()
285 mCallout->setOffsetFromLabelUnit( mOffsetFromLabelUnitWidget->unit() );
286 mCallout->setOffsetFromLabelMapUnitScale( mOffsetFromLabelUnitWidget->getMapUnitScale() );
290void QgsSimpleLineCalloutWidget::offsetFromLabelChanged()
292 mCallout->setOffsetFromLabel( mOffsetFromLabelSpin->value() );
296void QgsSimpleLineCalloutWidget::lineSymbolChanged()
298 mCallout->setLineSymbol( mCalloutLineStyleButton->clonedSymbol<
QgsLineSymbol >() );
302void QgsSimpleLineCalloutWidget::mAnchorPointComboBox_currentIndexChanged(
int index )
304 mCallout->setAnchorPoint(
static_cast<QgsCallout::AnchorPoint>( mAnchorPointComboBox->itemData( index ).toInt() ) );
308void QgsSimpleLineCalloutWidget::mLabelAnchorPointComboBox_currentIndexChanged(
int index )
314void QgsSimpleLineCalloutWidget::mCalloutBlendComboBox_currentIndexChanged(
int )
316 mCallout->setBlendMode( mCalloutBlendComboBox->blendMode() );
320void QgsSimpleLineCalloutWidget::drawToAllPartsToggled(
bool active )
322 mCallout->setDrawCalloutToAllParts( active );
331QgsManhattanLineCalloutWidget::QgsManhattanLineCalloutWidget(
QgsMapLayer *vl, QWidget *parent )
332 : QgsSimpleLineCalloutWidget( vl, parent )
342QgsCurvedLineCalloutWidget::QgsCurvedLineCalloutWidget(
QgsMapLayer *vl, QWidget *parent )
349 mCalloutLineStyleButton->setDialogTitle( tr(
"Callout Symbol" ) );
350 mCalloutLineStyleButton->registerExpressionContextGenerator(
this );
352 mCalloutLineStyleButton->setLayer( qobject_cast< QgsVectorLayer * >( vl ) );
361 connect( mMinCalloutLengthSpin,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsCurvedLineCalloutWidget::minimumLengthChanged );
364 connect( mOffsetFromAnchorSpin,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsCurvedLineCalloutWidget::offsetFromAnchorChanged );
366 connect( mOffsetFromLabelSpin,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsCurvedLineCalloutWidget::offsetFromLabelChanged );
368 connect( mDrawToAllPartsCheck, &QCheckBox::toggled,
this, &QgsCurvedLineCalloutWidget::drawToAllPartsToggled );
373 connect( mOrientationComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, [ = ](
int index )
384 connect( mAnchorPointComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsCurvedLineCalloutWidget::mAnchorPointComboBox_currentIndexChanged );
396 connect( mLabelAnchorPointComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsCurvedLineCalloutWidget::mLabelAnchorPointComboBox_currentIndexChanged );
398 connect( mCalloutLineStyleButton, &
QgsSymbolButton::changed,
this, &QgsCurvedLineCalloutWidget::lineSymbolChanged );
400 connect( mCurvatureSlider, &QSlider::valueChanged,
this, [ = ](
int value ) { mCurvatureSpinBox->setValue( value / 10.0 ); } );
401 connect( mCurvatureSpinBox,
static_cast < void (
QgsDoubleSpinBox::* )(
double )
> ( &QgsDoubleSpinBox::valueChanged ),
this, [ = ](
double value ) {
whileBlocking( mCurvatureSlider )->setValue( value * 10 ); } );
402 connect( mCurvatureSpinBox,
static_cast < void (
QgsDoubleSpinBox::* )(
double )
> ( &QgsDoubleSpinBox::valueChanged ),
this, [ = ](
double value )
404 mCallout->setCurvature( value / 100.0 );
408 connect( mCalloutBlendComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsCurvedLineCalloutWidget::mCalloutBlendComboBox_currentIndexChanged );
410 mPlacementDDGroupBox->setVisible( qobject_cast< QgsVectorLayer * >( vl ) );
413void QgsCurvedLineCalloutWidget::setCallout(
const QgsCallout *callout )
422 mMinCalloutWidthUnitWidget->blockSignals(
true );
423 mMinCalloutWidthUnitWidget->setUnit( mCallout->minimumLengthUnit() );
424 mMinCalloutWidthUnitWidget->setMapUnitScale( mCallout->minimumLengthMapUnitScale() );
425 mMinCalloutWidthUnitWidget->blockSignals(
false );
427 whileBlocking( mMinCalloutLengthSpin )->setValue( mCallout->minimumLength() );
429 mOffsetFromAnchorUnitWidget->blockSignals(
true );
430 mOffsetFromAnchorUnitWidget->setUnit( mCallout->offsetFromAnchorUnit() );
431 mOffsetFromAnchorUnitWidget->setMapUnitScale( mCallout->offsetFromAnchorMapUnitScale() );
432 mOffsetFromAnchorUnitWidget->blockSignals(
false );
433 mOffsetFromLabelUnitWidget->blockSignals(
true );
434 mOffsetFromLabelUnitWidget->setUnit( mCallout->offsetFromLabelUnit() );
435 mOffsetFromLabelUnitWidget->setMapUnitScale( mCallout->offsetFromLabelMapUnitScale() );
436 mOffsetFromLabelUnitWidget->blockSignals(
false );
437 whileBlocking( mOffsetFromAnchorSpin )->setValue( mCallout->offsetFromAnchor() );
438 whileBlocking( mOffsetFromLabelSpin )->setValue( mCallout->offsetFromLabel() );
440 whileBlocking( mCalloutLineStyleButton )->setSymbol( mCallout->lineSymbol()->clone() );
442 whileBlocking( mDrawToAllPartsCheck )->setChecked( mCallout->drawCalloutToAllParts() );
444 whileBlocking( mOrientationComboBox )->setCurrentIndex( mOrientationComboBox->findData(
static_cast< int >( mCallout->orientation() ) ) );
446 whileBlocking( mAnchorPointComboBox )->setCurrentIndex( mAnchorPointComboBox->findData(
static_cast< int >( callout->
anchorPoint() ) ) );
447 whileBlocking( mLabelAnchorPointComboBox )->setCurrentIndex( mLabelAnchorPointComboBox->findData(
static_cast< int >( callout->
labelAnchorPoint() ) ) );
449 whileBlocking( mCalloutBlendComboBox )->setBlendMode( mCallout->blendMode() );
451 whileBlocking( mCurvatureSpinBox )->setValue( mCallout->curvature() * 100.0 );
452 whileBlocking( mCurvatureSlider )->setValue( mCallout->curvature() * 1000.0 );
473 mAnchorPointLbl->setEnabled( isPolygon );
474 mAnchorPointLbl->setVisible( isPolygon );
475 mAnchorPointComboBox->setEnabled( isPolygon );
476 mAnchorPointComboBox->setVisible( isPolygon );
477 mAnchorPointDDBtn->setEnabled( isPolygon );
478 mAnchorPointDDBtn->setVisible( isPolygon );
481QgsCallout *QgsCurvedLineCalloutWidget::callout()
483 return mCallout.get();
486void QgsCurvedLineCalloutWidget::minimumLengthChanged()
488 mCallout->setMinimumLength( mMinCalloutLengthSpin->value() );
492void QgsCurvedLineCalloutWidget::minimumLengthUnitWidgetChanged()
494 mCallout->setMinimumLengthUnit( mMinCalloutWidthUnitWidget->unit() );
495 mCallout->setMinimumLengthMapUnitScale( mMinCalloutWidthUnitWidget->getMapUnitScale() );
499void QgsCurvedLineCalloutWidget::offsetFromAnchorUnitWidgetChanged()
501 mCallout->setOffsetFromAnchorUnit( mOffsetFromAnchorUnitWidget->unit() );
502 mCallout->setOffsetFromAnchorMapUnitScale( mOffsetFromAnchorUnitWidget->getMapUnitScale() );
506void QgsCurvedLineCalloutWidget::offsetFromAnchorChanged()
508 mCallout->setOffsetFromAnchor( mOffsetFromAnchorSpin->value() );
512void QgsCurvedLineCalloutWidget::offsetFromLabelUnitWidgetChanged()
514 mCallout->setOffsetFromLabelUnit( mOffsetFromLabelUnitWidget->unit() );
515 mCallout->setOffsetFromLabelMapUnitScale( mOffsetFromLabelUnitWidget->getMapUnitScale() );
519void QgsCurvedLineCalloutWidget::offsetFromLabelChanged()
521 mCallout->setOffsetFromLabel( mOffsetFromLabelSpin->value() );
525void QgsCurvedLineCalloutWidget::lineSymbolChanged()
527 mCallout->setLineSymbol( mCalloutLineStyleButton->clonedSymbol<
QgsLineSymbol >() );
531void QgsCurvedLineCalloutWidget::mAnchorPointComboBox_currentIndexChanged(
int index )
533 mCallout->setAnchorPoint(
static_cast<QgsCallout::AnchorPoint>( mAnchorPointComboBox->itemData( index ).toInt() ) );
537void QgsCurvedLineCalloutWidget::mLabelAnchorPointComboBox_currentIndexChanged(
int index )
543void QgsCurvedLineCalloutWidget::mCalloutBlendComboBox_currentIndexChanged(
int )
545 mCallout->setBlendMode( mCalloutBlendComboBox->blendMode() );
549void QgsCurvedLineCalloutWidget::drawToAllPartsToggled(
bool active )
551 mCallout->setDrawCalloutToAllParts( active );
560QgsBalloonCalloutWidget::QgsBalloonCalloutWidget(
QgsMapLayer *vl, QWidget *parent )
567 mCalloutFillStyleButton->setDialogTitle( tr(
"Balloon Symbol" ) );
568 mCalloutFillStyleButton->registerExpressionContextGenerator(
this );
571 mMarkerSymbolButton->setDialogTitle( tr(
"Marker Symbol" ) );
572 mMarkerSymbolButton->registerExpressionContextGenerator(
this );
573 mMarkerSymbolButton->setShowNull(
true );
574 mMarkerSymbolButton->setToNull();
576 mCalloutFillStyleButton->setLayer( qobject_cast< QgsVectorLayer * >( vl ) );
577 mMarkerSymbolButton->setLayer( qobject_cast< QgsVectorLayer * >( vl ) );
587 mSpinBottomMargin->setClearValue( 0 );
588 mSpinTopMargin->setClearValue( 0 );
589 mSpinRightMargin->setClearValue( 0 );
590 mSpinLeftMargin->setClearValue( 0 );
591 mWedgeWidthSpin->setClearValue( 2.64 );
592 mCornerRadiusSpin->setClearValue( 0.0 );
595 connect( mOffsetFromAnchorSpin,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsBalloonCalloutWidget::offsetFromAnchorChanged );
602 connect( mAnchorPointComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsBalloonCalloutWidget::mAnchorPointComboBox_currentIndexChanged );
607 connect( mSpinBottomMargin, qOverload< double >( &QDoubleSpinBox::valueChanged ),
this, [ = ](
double value )
611 mCallout->setMargins( margins );
614 connect( mSpinTopMargin, qOverload< double >( &QDoubleSpinBox::valueChanged ),
this, [ = ](
double value )
618 mCallout->setMargins( margins );
621 connect( mSpinLeftMargin, qOverload< double >( &QDoubleSpinBox::valueChanged ),
this, [ = ](
double value )
625 mCallout->setMargins( margins );
628 connect( mSpinRightMargin, qOverload< double >( &QDoubleSpinBox::valueChanged ),
this, [ = ](
double value )
632 mCallout->setMargins( margins );
637 mCallout->setMarginsUnit( mMarginUnitWidget->unit() );
643 mCallout->setWedgeWidthUnit( mWedgeWidthUnitWidget->unit() );
644 mCallout->setWedgeWidthMapUnitScale( mWedgeWidthUnitWidget->getMapUnitScale() );
647 connect( mWedgeWidthSpin, qOverload< double >( &QDoubleSpinBox::valueChanged ),
this, [ = ](
double value )
649 mCallout->setWedgeWidth( value );
655 mCallout->setCornerRadiusUnit( mCornerRadiusUnitWidget->unit() );
656 mCallout->setCornerRadiusMapUnitScale( mCornerRadiusUnitWidget->getMapUnitScale() );
659 connect( mCornerRadiusSpin, qOverload< double >( &QDoubleSpinBox::valueChanged ),
this, [ = ](
double value )
661 mCallout->setCornerRadius( value );
665 connect( mCalloutBlendComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsBalloonCalloutWidget::mCalloutBlendComboBox_currentIndexChanged );
667 mPlacementDDGroupBox->setVisible( qobject_cast< QgsVectorLayer * >( vl ) );
670void QgsBalloonCalloutWidget::setCallout(
const QgsCallout *callout )
679 mOffsetFromAnchorUnitWidget->blockSignals(
true );
680 mOffsetFromAnchorUnitWidget->setUnit( mCallout->offsetFromAnchorUnit() );
681 mOffsetFromAnchorUnitWidget->setMapUnitScale( mCallout->offsetFromAnchorMapUnitScale() );
682 mOffsetFromAnchorUnitWidget->blockSignals(
false );
683 whileBlocking( mOffsetFromAnchorSpin )->setValue( mCallout->offsetFromAnchor() );
685 whileBlocking( mSpinBottomMargin )->setValue( mCallout->margins().bottom() );
686 whileBlocking( mSpinTopMargin )->setValue( mCallout->margins().top() );
687 whileBlocking( mSpinLeftMargin )->setValue( mCallout->margins().left() );
688 whileBlocking( mSpinRightMargin )->setValue( mCallout->margins().right() );
689 whileBlocking( mMarginUnitWidget )->setUnit( mCallout->marginsUnit() );
691 mWedgeWidthUnitWidget->blockSignals(
true );
692 mWedgeWidthUnitWidget->setUnit( mCallout->wedgeWidthUnit() );
693 mWedgeWidthUnitWidget->setMapUnitScale( mCallout->wedgeWidthMapUnitScale() );
694 mWedgeWidthUnitWidget->blockSignals(
false );
695 whileBlocking( mWedgeWidthSpin )->setValue( mCallout->wedgeWidth() );
697 mCornerRadiusUnitWidget->blockSignals(
true );
698 mCornerRadiusUnitWidget->setUnit( mCallout->cornerRadiusUnit() );
699 mCornerRadiusUnitWidget->setMapUnitScale( mCallout->cornerRadiusMapUnitScale() );
700 mCornerRadiusUnitWidget->blockSignals(
false );
701 whileBlocking( mCornerRadiusSpin )->setValue( mCallout->cornerRadius() );
703 whileBlocking( mCalloutFillStyleButton )->setSymbol( mCallout->fillSymbol()->clone() );
705 whileBlocking( mMarkerSymbolButton )->setSymbol( marker->clone() );
709 whileBlocking( mAnchorPointComboBox )->setCurrentIndex( mAnchorPointComboBox->findData(
static_cast< int >( callout->
anchorPoint() ) ) );
711 whileBlocking( mCalloutBlendComboBox )->setBlendMode( mCallout->blendMode() );
727 mAnchorPointLbl->setEnabled( isPolygon );
728 mAnchorPointLbl->setVisible( isPolygon );
729 mAnchorPointComboBox->setEnabled( isPolygon );
730 mAnchorPointComboBox->setVisible( isPolygon );
731 mAnchorPointDDBtn->setEnabled( isPolygon );
732 mAnchorPointDDBtn->setVisible( isPolygon );
737 return mCallout.get();
740void QgsBalloonCalloutWidget::offsetFromAnchorUnitWidgetChanged()
742 mCallout->setOffsetFromAnchorUnit( mOffsetFromAnchorUnitWidget->unit() );
743 mCallout->setOffsetFromAnchorMapUnitScale( mOffsetFromAnchorUnitWidget->getMapUnitScale() );
747void QgsBalloonCalloutWidget::offsetFromAnchorChanged()
749 mCallout->setOffsetFromAnchor( mOffsetFromAnchorSpin->value() );
753void QgsBalloonCalloutWidget::fillSymbolChanged()
755 mCallout->setFillSymbol( mCalloutFillStyleButton->clonedSymbol<
QgsFillSymbol >() );
759void QgsBalloonCalloutWidget::markerSymbolChanged()
761 mCallout->setMarkerSymbol( mMarkerSymbolButton->isNull() ?
nullptr : mMarkerSymbolButton->clonedSymbol<
QgsMarkerSymbol >() );
765void QgsBalloonCalloutWidget::mAnchorPointComboBox_currentIndexChanged(
int index )
767 mCallout->setAnchorPoint(
static_cast<QgsCallout::AnchorPoint>( mAnchorPointComboBox->itemData( index ).toInt() ) );
771void QgsBalloonCalloutWidget::mCalloutBlendComboBox_currentIndexChanged(
int )
773 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.