29#include <QColorDialog>
35 , mScalebar( scaleBar )
39 mNumberOfSubdivisionsSpinBox->setClearValue( 1 );
41 connect( mHeightSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutScaleBarWidget::mHeightSpinBox_valueChanged );
42 connect( mSegmentSizeSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutScaleBarWidget::mSegmentSizeSpinBox_valueChanged );
43 connect( mSegmentsLeftSpinBox,
static_cast < void ( QSpinBox::* )(
int )
> ( &QSpinBox::valueChanged ),
this, &QgsLayoutScaleBarWidget::mSegmentsLeftSpinBox_valueChanged );
44 connect( mNumberOfSegmentsSpinBox,
static_cast < void ( QSpinBox::* )(
int )
> ( &QSpinBox::valueChanged ),
this, &QgsLayoutScaleBarWidget::mNumberOfSegmentsSpinBox_valueChanged );
45 connect( mNumberOfSubdivisionsSpinBox,
static_cast < void ( QSpinBox::* )(
int )
> ( &QSpinBox::valueChanged ),
this, &QgsLayoutScaleBarWidget::mNumberOfSubdivisionsSpinBox_valueChanged );
46 connect( mSubdivisionsHeightSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutScaleBarWidget::mSubdivisionsHeightSpinBox_valueChanged );
47 connect( mUnitLabelLineEdit, &QLineEdit::textChanged,
this, &QgsLayoutScaleBarWidget::mUnitLabelLineEdit_textChanged );
48 connect( mMapUnitsPerBarUnitSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutScaleBarWidget::mMapUnitsPerBarUnitSpinBox_valueChanged );
49 connect( mStyleComboBox, &QComboBox::currentTextChanged,
this, &QgsLayoutScaleBarWidget::mStyleComboBox_currentIndexChanged );
50 connect( mLabelBarSpaceSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutScaleBarWidget::mLabelBarSpaceSpinBox_valueChanged );
51 connect( mBoxSizeSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutScaleBarWidget::mBoxSizeSpinBox_valueChanged );
53 connect( mDistanceLabelPlacementComboBox, qOverload<int>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutScaleBarWidget::mDistanceLabelPlacementComboBox_currentIndexChanged );
54 connect( mUnitsComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutScaleBarWidget::mUnitsComboBox_currentIndexChanged );
55 connect( mMinWidthSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutScaleBarWidget::mMinWidthSpinBox_valueChanged );
56 connect( mMaxWidthSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutScaleBarWidget::mMaxWidthSpinBox_valueChanged );
57 connect( mNumberFormatPushButton, &QPushButton::clicked,
this, &QgsLayoutScaleBarWidget::changeNumberFormat );
68 mSegmentsLeftDDBtn->registerEnabledWidget( mSegmentsLeftSpinBox,
false );
69 mSegmentsRightDDBtn->registerEnabledWidget( mNumberOfSegmentsSpinBox,
false );
70 mSegmentSizeDDBtn->registerEnabledWidget( mSegmentSizeSpinBox,
false );
71 mMinWidthDDBtn->registerEnabledWidget( mMinWidthSpinBox,
false );
72 mMaxWidthDDBtn->registerEnabledWidget( mMaxWidthSpinBox,
false );
76 mFontButton->registerExpressionContextGenerator(
this );
78 connectUpdateSignal();
82 mainLayout->addWidget( mItemPropertiesWidget );
84 mSegmentSizeRadioGroup.addButton( mFixedSizeRadio );
85 mSegmentSizeRadioGroup.addButton( mFitWidthRadio );
86 connect( &mSegmentSizeRadioGroup,
static_cast < void ( QButtonGroup::* )( QAbstractButton * )
> ( &QButtonGroup::buttonClicked ),
this, &QgsLayoutScaleBarWidget::segmentSizeRadioChanged );
88 blockMemberSignals(
true );
92 for (
const QString &renderer : renderers )
98 mDistanceLabelPlacementComboBox->addItem( tr(
"Above Segment Edges" ),
static_cast< int >( DistanceLabelPlacement::CenteredAboveSegmentEdges ) );
99 mDistanceLabelPlacementComboBox->addItem( tr(
"Above Segment Centers" ),
static_cast< int >( DistanceLabelPlacement::CenteredAboveSegmentCenters ) );
100 mDistanceLabelPlacementComboBox->addItem( tr(
"Below Segment Edges" ),
static_cast< int >( DistanceLabelPlacement::CenteredBelowSegmentEdges ) );
101 mDistanceLabelPlacementComboBox->addItem( tr(
"Below Segment Centers" ),
static_cast< int >( DistanceLabelPlacement::CenteredBelowSegmentCenters ) );
104 mAlignmentComboBox->setAvailableAlignments( Qt::AlignLeft | Qt::AlignHCenter | Qt::AlignRight );
125 connect( mSubdivisionStyleButton, &
QgsSymbolButton::changed,
this, &QgsLayoutScaleBarWidget::subdivisionSymbolChanged );
133 mFontButton->setDialogTitle( tr(
"Scalebar Font" ) );
138 QgsLayout *scaleBarLayout = mScalebar->layout();
139 if ( scaleBarLayout )
141 mMapItemComboBox->setCurrentLayout( scaleBarLayout );
148 blockMemberSignals(
false );
151 mLineStyleButton->registerExpressionContextGenerator( mScalebar );
153 mDivisionStyleButton->registerExpressionContextGenerator( mScalebar );
155 mSubdivisionStyleButton->registerExpressionContextGenerator( mScalebar );
157 mFillSymbol1Button->registerExpressionContextGenerator( mScalebar );
159 mFillSymbol2Button->registerExpressionContextGenerator( mScalebar );
164 if ( mScalebar->layout() )
177 if ( mItemPropertiesWidget )
196 disconnectUpdateSignal();
198 mScalebar = qobject_cast< QgsLayoutItemScaleBar * >( item );
199 mItemPropertiesWidget->
setItem( mScalebar );
203 connectUpdateSignal();
204 mFillSymbol1Button->registerExpressionContextGenerator( mScalebar );
205 mFillSymbol2Button->registerExpressionContextGenerator( mScalebar );
206 mLineStyleButton->registerExpressionContextGenerator( mScalebar );
207 mDivisionStyleButton->registerExpressionContextGenerator( mScalebar );
208 mSubdivisionStyleButton->registerExpressionContextGenerator( mScalebar );
216void QgsLayoutScaleBarWidget::lineSymbolChanged()
222 mScalebar->setLineSymbol( mLineStyleButton->clonedSymbol<
QgsLineSymbol>() );
224 mScalebar->layout()->undoStack()->endCommand();
227void QgsLayoutScaleBarWidget::divisionSymbolChanged()
233 mScalebar->setDivisionLineSymbol( mDivisionStyleButton->clonedSymbol<
QgsLineSymbol>() );
235 mScalebar->layout()->undoStack()->endCommand();
238void QgsLayoutScaleBarWidget::subdivisionSymbolChanged()
244 mScalebar->setSubdivisionLineSymbol( mSubdivisionStyleButton->clonedSymbol<
QgsLineSymbol>() );
246 mScalebar->layout()->undoStack()->endCommand();
249void QgsLayoutScaleBarWidget::fillSymbol1Changed()
255 mScalebar->setFillSymbol( mFillSymbol1Button->clonedSymbol<
QgsFillSymbol>() );
257 mScalebar->layout()->undoStack()->endCommand();
260void QgsLayoutScaleBarWidget::fillSymbol2Changed()
266 mScalebar->setAlternateFillSymbol( mFillSymbol2Button->clonedSymbol<
QgsFillSymbol>() );
268 mScalebar->layout()->undoStack()->endCommand();
271void QgsLayoutScaleBarWidget::setGuiElements()
278 blockMemberSignals(
true );
279 mNumberOfSegmentsSpinBox->setValue( mScalebar->numberOfSegments() );
280 mSegmentsLeftSpinBox->setValue( mScalebar->numberOfSegmentsLeft() );
281 mSegmentSizeSpinBox->setValue( mScalebar->unitsPerSegment() );
282 mHeightSpinBox->setValue( mScalebar->height() );
283 mNumberOfSubdivisionsSpinBox->setValue( mScalebar->numberOfSubdivisions() );
284 mSubdivisionsHeightSpinBox->setValue( mScalebar->subdivisionsHeight() );
285 mMapUnitsPerBarUnitSpinBox->setValue( mScalebar->mapUnitsPerScaleBarUnit() );
286 mLabelBarSpaceSpinBox->setValue( mScalebar->labelBarSpace() );
287 mBoxSizeSpinBox->setValue( mScalebar->boxContentSpace() );
288 mUnitLabelLineEdit->setText( mScalebar->unitLabel() );
289 mFontButton->setTextFormat( mScalebar->textFormat() );
291 whileBlocking( mLineStyleButton )->setSymbol( mScalebar->lineSymbol()->clone() );
292 whileBlocking( mDivisionStyleButton )->setSymbol( mScalebar->divisionLineSymbol()->clone() );
293 whileBlocking( mSubdivisionStyleButton )->setSymbol( mScalebar->subdivisionLineSymbol()->clone() );
294 whileBlocking( mFillSymbol1Button )->setSymbol( mScalebar->fillSymbol()->clone() );
295 whileBlocking( mFillSymbol2Button )->setSymbol( mScalebar->alternateFillSymbol()->clone() );
298 mMapItemComboBox->setItem( mScalebar->linkedMap() );
301 const QString style = mScalebar->style();
302 mStyleComboBox->setCurrentIndex( mStyleComboBox->findData( style ) );
303 toggleStyleSpecificControls( style );
306 mDistanceLabelPlacementComboBox->setCurrentIndex( mDistanceLabelPlacementComboBox->findData(
static_cast< int >(
307 distanceLabelPlacement( mScalebar->labelHorizontalPlacement(), mScalebar->labelVerticalPlacement() ) ) ) );
311 Qt::Alignment a = Qt::AlignLeft;
312 switch ( mScalebar->alignment() )
321 a = Qt::AlignHCenter;
324 mAlignmentComboBox->setCurrentAlignment( a );
327 mUnitsComboBox->setCurrentIndex( mUnitsComboBox->findData(
static_cast< int >( mScalebar->units() ) ) );
329 switch ( mScalebar->segmentSizeMode() )
333 mFixedSizeRadio->setChecked(
true );
334 mSegmentSizeWidget->setEnabled(
true );
335 mMinWidthWidget->setEnabled(
false );
336 mMaxWidthWidget->setEnabled(
false );
342 mFitWidthRadio->setChecked(
true );
343 mSegmentSizeWidget->setEnabled(
false );
344 mMinWidthWidget->setEnabled(
true );
345 mMaxWidthWidget->setEnabled(
true );
349 mMinWidthSpinBox->setValue( mScalebar->minimumBarWidth() );
350 mMaxWidthSpinBox->setValue( mScalebar->maximumBarWidth() );
352 populateDataDefinedButtons();
354 blockMemberSignals(
false );
359void QgsLayoutScaleBarWidget::mSegmentSizeSpinBox_valueChanged(
double d )
367 disconnectUpdateSignal();
368 mScalebar->setUnitsPerSegment( d );
370 connectUpdateSignal();
371 mScalebar->endCommand();
374void QgsLayoutScaleBarWidget::mSegmentsLeftSpinBox_valueChanged(
int i )
382 disconnectUpdateSignal();
383 mScalebar->setNumberOfSegmentsLeft( i );
385 connectUpdateSignal();
386 mScalebar->endCommand();
389void QgsLayoutScaleBarWidget::mNumberOfSegmentsSpinBox_valueChanged(
int i )
397 disconnectUpdateSignal();
398 mScalebar->setNumberOfSegments( i );
400 connectUpdateSignal();
401 mScalebar->endCommand();
404void QgsLayoutScaleBarWidget::mHeightSpinBox_valueChanged(
double d )
411 disconnectUpdateSignal();
412 mScalebar->setHeight( d );
414 connectUpdateSignal();
415 mScalebar->endCommand();
418void QgsLayoutScaleBarWidget::mNumberOfSubdivisionsSpinBox_valueChanged(
int i )
426 disconnectUpdateSignal();
427 mScalebar->setNumberOfSubdivisions( i );
429 connectUpdateSignal();
430 mScalebar->endCommand();
433void QgsLayoutScaleBarWidget::mSubdivisionsHeightSpinBox_valueChanged(
double d )
440 disconnectUpdateSignal();
441 mScalebar->setSubdivisionsHeight( d );
443 connectUpdateSignal();
444 mScalebar->endCommand();
447void QgsLayoutScaleBarWidget::textFormatChanged()
454 mScalebar->beginCommand( tr(
"Set Scalebar Font" ) );
455 disconnectUpdateSignal();
456 mScalebar->setTextFormat( mFontButton->textFormat() );
457 connectUpdateSignal();
458 mScalebar->endCommand();
462void QgsLayoutScaleBarWidget::changeNumberFormat()
471 widget->
setFormat( mScalebar->numericFormat() );
474 mScalebar->beginCommand( tr(
"Set Scalebar Number Format" ) );
475 disconnectUpdateSignal();
476 mScalebar->setNumericFormat( widget->
format() );
477 connectUpdateSignal();
478 mScalebar->endCommand();
487 switch ( horizontalPlacement )
490 switch ( verticalPlacement )
493 return DistanceLabelPlacement::CenteredAboveSegmentEdges;
495 return DistanceLabelPlacement::CenteredBelowSegmentEdges;
500 switch ( verticalPlacement )
503 return DistanceLabelPlacement::CenteredAboveSegmentCenters;
505 return DistanceLabelPlacement::CenteredBelowSegmentCenters;
512void QgsLayoutScaleBarWidget::mUnitLabelLineEdit_textChanged(
const QString &text )
520 disconnectUpdateSignal();
521 mScalebar->setUnitLabel( text );
523 connectUpdateSignal();
524 mScalebar->endCommand();
527void QgsLayoutScaleBarWidget::mMapUnitsPerBarUnitSpinBox_valueChanged(
double d )
535 disconnectUpdateSignal();
536 mScalebar->setMapUnitsPerScaleBarUnit( d );
538 connectUpdateSignal();
539 mScalebar->endCommand();
542void QgsLayoutScaleBarWidget::mStyleComboBox_currentIndexChanged(
const QString & )
549 const QString rendererId = mStyleComboBox->currentData().toString();
550 if ( rendererId == mScalebar->style() )
553 mScalebar->beginCommand( tr(
"Set Scalebar Style" ) );
554 disconnectUpdateSignal();
556 bool defaultsApplied =
false;
559 defaultsApplied = mScalebar->applyDefaultRendererSettings( renderer.get() );
562 toggleStyleSpecificControls( rendererId );
564 mScalebar->setStyle( rendererId );
566 connectUpdateSignal();
567 mScalebar->endCommand();
569 if ( defaultsApplied )
573void QgsLayoutScaleBarWidget::toggleStyleSpecificControls(
const QString &style )
589 if ( !mGroupBoxUnits->isEnabled() )
590 mGroupBoxSegments->setCollapsed(
true );
610void QgsLayoutScaleBarWidget::mLabelBarSpaceSpinBox_valueChanged(
double d )
618 disconnectUpdateSignal();
619 mScalebar->setLabelBarSpace( d );
621 connectUpdateSignal();
622 mScalebar->endCommand();
625void QgsLayoutScaleBarWidget::mBoxSizeSpinBox_valueChanged(
double d )
633 disconnectUpdateSignal();
634 mScalebar->setBoxContentSpace( d );
636 connectUpdateSignal();
637 mScalebar->endCommand();
640void QgsLayoutScaleBarWidget::mDistanceLabelPlacementComboBox_currentIndexChanged(
int index )
647 mScalebar->beginCommand( tr(
"Set Scalebar Label Placement" ) );
648 disconnectUpdateSignal();
650 const DistanceLabelPlacement placement =
static_cast<DistanceLabelPlacement
>( mDistanceLabelPlacementComboBox->itemData( index ).toInt() );
653 case DistanceLabelPlacement::CenteredAboveSegmentEdges:
657 case DistanceLabelPlacement::CenteredAboveSegmentCenters:
661 case DistanceLabelPlacement::CenteredBelowSegmentEdges:
665 case DistanceLabelPlacement::CenteredBelowSegmentCenters:
672 connectUpdateSignal();
673 mScalebar->endCommand();
676void QgsLayoutScaleBarWidget::alignmentChanged()
683 mScalebar->beginCommand( tr(
"Set Scalebar Alignment" ) );
684 disconnectUpdateSignal();
688 mScalebar->setAlignment( a );
690 connectUpdateSignal();
691 mScalebar->endCommand();
694void QgsLayoutScaleBarWidget::mUnitsComboBox_currentIndexChanged(
int index )
701 const QVariant unitData = mUnitsComboBox->itemData( index );
702 if ( unitData.userType() == QMetaType::Type::UnknownType )
707 disconnectUpdateSignal();
708 mScalebar->beginCommand( tr(
"Set Scalebar Units" ) );
712 mNumberOfSegmentsSpinBox->setValue( mScalebar->numberOfSegments() );
713 mSegmentsLeftSpinBox->setValue( mScalebar->numberOfSegmentsLeft() );
714 mUnitLabelLineEdit->setText( mScalebar->unitLabel() );
715 mSegmentSizeSpinBox->setValue( mScalebar->unitsPerSegment() );
716 mMapUnitsPerBarUnitSpinBox->setValue( mScalebar->mapUnitsPerScaleBarUnit() );
718 connectUpdateSignal();
719 mScalebar->endCommand();
722void QgsLayoutScaleBarWidget::blockMemberSignals(
bool block )
724 mSegmentSizeSpinBox->blockSignals( block );
725 mNumberOfSegmentsSpinBox->blockSignals( block );
726 mSegmentsLeftSpinBox->blockSignals( block );
727 mNumberOfSubdivisionsSpinBox->blockSignals( block );
728 mSubdivisionsHeightSpinBox->blockSignals( block );
729 mStyleComboBox->blockSignals( block );
730 mUnitLabelLineEdit->blockSignals( block );
731 mMapUnitsPerBarUnitSpinBox->blockSignals( block );
732 mHeightSpinBox->blockSignals( block );
733 mLineStyleButton->blockSignals( block );
734 mDivisionStyleButton->blockSignals( block );
735 mSubdivisionStyleButton->blockSignals( block );
736 mLabelBarSpaceSpinBox->blockSignals( block );
737 mBoxSizeSpinBox->blockSignals( block );
738 mDistanceLabelPlacementComboBox->blockSignals( block );
739 mAlignmentComboBox->blockSignals( block );
740 mUnitsComboBox->blockSignals( block );
741 mFillSymbol1Button->blockSignals( block );
742 mFillSymbol2Button->blockSignals( block );
743 mSegmentSizeRadioGroup.blockSignals( block );
744 mMapItemComboBox->blockSignals( block );
745 mFontButton->blockSignals( block );
746 mMinWidthSpinBox->blockSignals( block );
747 mMaxWidthSpinBox->blockSignals( block );
750void QgsLayoutScaleBarWidget::connectUpdateSignal()
758void QgsLayoutScaleBarWidget::disconnectUpdateSignal()
766void QgsLayoutScaleBarWidget::segmentSizeRadioChanged( QAbstractButton *radio )
768 const bool fixedSizeMode = radio == mFixedSizeRadio;
769 mMinWidthWidget->setEnabled( !fixedSizeMode );
770 mMaxWidthWidget->setEnabled( !fixedSizeMode );
771 mSegmentSizeWidget->setEnabled( fixedSizeMode );
779 disconnectUpdateSignal();
780 if ( mFixedSizeRadio->isChecked() )
783 mScalebar->setUnitsPerSegment( mSegmentSizeSpinBox->value() );
790 connectUpdateSignal();
791 mScalebar->endCommand();
794void QgsLayoutScaleBarWidget::mapChanged(
QgsLayoutItem *item )
803 mScalebar->beginCommand( tr(
"Set Scalebar Map" ) );
804 disconnectUpdateSignal();
805 mScalebar->setLinkedMap( map );
807 connectUpdateSignal();
808 mScalebar->endCommand();
811void QgsLayoutScaleBarWidget::mMinWidthSpinBox_valueChanged(
double )
819 disconnectUpdateSignal();
820 mScalebar->setMinimumBarWidth( mMinWidthSpinBox->value() );
822 connectUpdateSignal();
823 mScalebar->endCommand();
826void QgsLayoutScaleBarWidget::mMaxWidthSpinBox_valueChanged(
double )
834 disconnectUpdateSignal();
835 mScalebar->setMaximumBarWidth( mMaxWidthSpinBox->value() );
837 connectUpdateSignal();
838 mScalebar->endCommand();
841void QgsLayoutScaleBarWidget::populateDataDefinedButtons()
ScaleBarDistanceLabelHorizontalPlacement
Scale bar distance label horizontal placement.
@ CenteredSegment
Labels are drawn centered relative to segment.
@ CenteredEdge
Labels are drawn centered relative to segment's edge.
ScaleBarDistanceLabelVerticalPlacement
Scale bar distance label vertical placement.
@ AboveSegment
Labels are drawn above the scalebar.
@ BelowSegment
Labels are drawn below the scalebar.
ScaleBarAlignment
Scalebar alignment.
DistanceUnit
Units of distance.
@ Centimeters
Centimeters.
@ Millimeters
Millimeters.
@ Miles
Terrestrial miles.
@ Unknown
Unknown distance unit.
@ NauticalMiles
Nautical miles.
@ FitWidth
Scale bar segment size is calculated to fit a size range.
@ Fixed
Scale bar segment size is fixed to a map unit.
void changed()
Emitted when the alignment is changed.
static QgsScaleBarRendererRegistry * scaleBarRendererRegistry()
Gets the registry of available scalebar renderers.
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.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
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.
A fill symbol type, for rendering Polygon and MultiPolygon geometries.
void itemChanged(QgsLayoutItem *item)
Emitted whenever the currently selected item changes.
Layout graphical items for displaying a map.
@ LayoutScaleBar
Scale bar item.
A layout item subclass for scale bars.
Base class for graphical items within a QgsLayout.
@ UndoScaleBarSubdivisionsHeight
Scalebar subdivisions height.
@ UndoScaleBarLabelBarSize
Scalebar label bar size.
@ UndoScaleBarMapUnitsSegment
Scalebar map units per segment.
@ UndoScaleBarBoxContentSpace
Scalebar box context space.
@ UndoScaleBarSegmentSize
Scalebar segment size.
@ UndoScaleBarHeight
Scalebar height.
@ UndoScaleBarSegments
Scalebar number of segments.
@ UndoScaleBarSubdivisions
Scalebar number of subdivisions.
@ UndoShapeStyle
Shape symbol style.
@ UndoScaleBarSegmentsLeft
Scalebar segments left.
@ UndoScaleBarUnitText
Scalebar unit text.
int type() const override
Returns a unique graphics item type identifier.
void changed()
Emitted when the object's properties change.
@ ScalebarMinimumWidth
Scalebar segment minimum width.
@ ScalebarRightSegments
Number of segments on the right of 0.
@ ScalebarRightSegmentSubdivisions
Number of subdivisions per segment on right of 0.
@ ScalebarMaximumWidth
Scalebar segment maximum width.
@ ScalebarHeight
Scalebar height.
@ ScalebarSubdivisionHeight
Scalebar subdivision height.
@ ScalebarLeftSegments
Number of segments on the left of 0.
@ ScalebarSegmentWidth
Scalebar width in map units of a single segment.
void layerChanged(QgsVectorLayer *layer)
Emitted when the context's layer is changed.
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
A line symbol type, for rendering LineString and MultiLineString geometries.
Interface for master layout type objects, such as print layouts and reports.
QStringList sortedRendererList() const
Returns a list of the renderer ids currently contained in the registry, sorted in an order respecting...
QString visibleName(const QString &id) const
Returns the translated, user-visible name for the renderer with matching id.
@ FlagUsesLabelVerticalPlacement
Renderer uses the QgsScaleBarSettings::labelVerticalPlacement() setting.
@ FlagUsesLabelHorizontalPlacement
Renderer uses the QgsScaleBarSettings::labelHorizontalPlacement() setting.
@ FlagUsesLineSymbol
Renderer utilizes the scalebar line symbol (see QgsScaleBarSettings::lineSymbol() )
@ FlagUsesUnitLabel
Renderer uses the QgsScaleBarSettings::unitLabel() setting.
@ FlagUsesSubdivisionsHeight
Renderer uses the scalebar subdivisions height (see QgsScaleBarSettings::subdivisionsHeight() )
@ FlagUsesSubdivisionSymbol
Renderer utilizes the scalebar subdivision symbol (see QgsScaleBarSettings::subdivisionLineSymbol() )
@ FlagUsesSegments
Renderer uses the scalebar segments.
@ FlagUsesLabelBarSpace
Renderer uses the QgsScaleBarSettings::labelBarSpace() setting.
@ FlagUsesAlignment
Renderer uses the QgsScaleBarSettings::alignment() setting.
@ FlagUsesFillSymbol
Renderer utilizes the scalebar fill symbol (see QgsScaleBarSettings::fillSymbol() )
@ FlagRespectsMapUnitsPerScaleBarUnit
Renderer respects the QgsScaleBarSettings::mapUnitsPerScaleBarUnit() setting.
@ FlagRespectsUnits
Renderer respects the QgsScaleBarSettings::units() setting.
@ FlagUsesAlternateFillSymbol
Renderer utilizes the alternate scalebar fill symbol (see QgsScaleBarSettings::alternateFillSymbol() ...
@ FlagUsesSubdivisions
Renderer uses the scalebar subdivisions (see QgsScaleBarSettings::numberOfSubdivisions() )
@ FlagUsesDivisionSymbol
Renderer utilizes the scalebar division symbol (see QgsScaleBarSettings::divisionLineSymbol() )
#define BUILTIN_UNREACHABLE
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.