18#include "moc_qgslayoutscalebarwidget.cpp"
30#include <QColorDialog>
36 , mScalebar( scaleBar )
40 mNumberOfSubdivisionsSpinBox->setClearValue( 1 );
42 connect( mHeightSpinBox,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutScaleBarWidget::mHeightSpinBox_valueChanged );
43 connect( mSegmentSizeSpinBox,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutScaleBarWidget::mSegmentSizeSpinBox_valueChanged );
44 connect( mSegmentsLeftSpinBox,
static_cast<void ( QSpinBox::* )(
int )
>( &QSpinBox::valueChanged ),
this, &QgsLayoutScaleBarWidget::mSegmentsLeftSpinBox_valueChanged );
45 connect( mNumberOfSegmentsSpinBox,
static_cast<void ( QSpinBox::* )(
int )
>( &QSpinBox::valueChanged ),
this, &QgsLayoutScaleBarWidget::mNumberOfSegmentsSpinBox_valueChanged );
46 connect( mNumberOfSubdivisionsSpinBox,
static_cast<void ( QSpinBox::* )(
int )
>( &QSpinBox::valueChanged ),
this, &QgsLayoutScaleBarWidget::mNumberOfSubdivisionsSpinBox_valueChanged );
47 connect( mSubdivisionsHeightSpinBox,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutScaleBarWidget::mSubdivisionsHeightSpinBox_valueChanged );
48 connect( mUnitLabelLineEdit, &QLineEdit::textChanged,
this, &QgsLayoutScaleBarWidget::mUnitLabelLineEdit_textChanged );
49 connect( mMapUnitsPerBarUnitSpinBox,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutScaleBarWidget::mMapUnitsPerBarUnitSpinBox_valueChanged );
50 connect( mStyleComboBox, &QComboBox::currentTextChanged,
this, &QgsLayoutScaleBarWidget::mStyleComboBox_currentIndexChanged );
51 connect( mLabelBarSpaceSpinBox,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutScaleBarWidget::mLabelBarSpaceSpinBox_valueChanged );
52 connect( mBoxSizeSpinBox,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutScaleBarWidget::mBoxSizeSpinBox_valueChanged );
54 connect( mDistanceLabelPlacementComboBox, qOverload<int>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutScaleBarWidget::mDistanceLabelPlacementComboBox_currentIndexChanged );
55 connect( mUnitsComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutScaleBarWidget::mUnitsComboBox_currentIndexChanged );
56 connect( mMinWidthSpinBox,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutScaleBarWidget::mMinWidthSpinBox_valueChanged );
57 connect( mMaxWidthSpinBox,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutScaleBarWidget::mMaxWidthSpinBox_valueChanged );
58 connect( mNumberFormatPushButton, &QPushButton::clicked,
this, &QgsLayoutScaleBarWidget::changeNumberFormat );
59 connect( mMethodCombo, qOverload<int>( &QComboBox::currentIndexChanged ),
this, [=] {
65 disconnectUpdateSignal();
66 mScalebar->beginCommand( tr(
"Set Scalebar Method" ) );
69 connectUpdateSignal();
70 mScalebar->endCommand();
82 mSegmentsLeftDDBtn->registerEnabledWidget( mSegmentsLeftSpinBox,
false );
83 mSegmentsRightDDBtn->registerEnabledWidget( mNumberOfSegmentsSpinBox,
false );
84 mSegmentSizeDDBtn->registerEnabledWidget( mSegmentSizeSpinBox,
false );
85 mMinWidthDDBtn->registerEnabledWidget( mMinWidthSpinBox,
false );
86 mMaxWidthDDBtn->registerEnabledWidget( mMaxWidthSpinBox,
false );
90 mFontButton->registerExpressionContextGenerator(
this );
92 connectUpdateSignal();
96 mainLayout->addWidget( mItemPropertiesWidget );
98 mSegmentSizeRadioGroup.addButton( mFixedSizeRadio );
99 mSegmentSizeRadioGroup.addButton( mFitWidthRadio );
100 connect( &mSegmentSizeRadioGroup,
static_cast<void ( QButtonGroup::* )( QAbstractButton * )
>( &QButtonGroup::buttonClicked ),
this, &QgsLayoutScaleBarWidget::segmentSizeRadioChanged );
102 blockMemberSignals(
true );
106 for (
const QString &renderer : renderers )
112 mDistanceLabelPlacementComboBox->addItem( tr(
"Above Segment Edges" ),
static_cast<int>( DistanceLabelPlacement::CenteredAboveSegmentEdges ) );
113 mDistanceLabelPlacementComboBox->addItem( tr(
"Above Segment Centers" ),
static_cast<int>( DistanceLabelPlacement::CenteredAboveSegmentCenters ) );
114 mDistanceLabelPlacementComboBox->addItem( tr(
"Below Segment Edges" ),
static_cast<int>( DistanceLabelPlacement::CenteredBelowSegmentEdges ) );
115 mDistanceLabelPlacementComboBox->addItem( tr(
"Below Segment Centers" ),
static_cast<int>( DistanceLabelPlacement::CenteredBelowSegmentCenters ) );
118 mAlignmentComboBox->setAvailableAlignments( Qt::AlignLeft | Qt::AlignHCenter | Qt::AlignRight );
144 connect( mSubdivisionStyleButton, &
QgsSymbolButton::changed,
this, &QgsLayoutScaleBarWidget::subdivisionSymbolChanged );
152 mFontButton->setDialogTitle( tr(
"Scalebar Font" ) );
157 QgsLayout *scaleBarLayout = mScalebar->layout();
158 if ( scaleBarLayout )
160 mMapItemComboBox->setCurrentLayout( scaleBarLayout );
167 blockMemberSignals(
false );
170 mLineStyleButton->registerExpressionContextGenerator( mScalebar );
172 mDivisionStyleButton->registerExpressionContextGenerator( mScalebar );
174 mSubdivisionStyleButton->registerExpressionContextGenerator( mScalebar );
176 mFillSymbol1Button->registerExpressionContextGenerator( mScalebar );
178 mFillSymbol2Button->registerExpressionContextGenerator( mScalebar );
183 if ( mScalebar->layout() )
196 if ( mItemPropertiesWidget )
215 disconnectUpdateSignal();
217 mScalebar = qobject_cast<QgsLayoutItemScaleBar *>( item );
218 mItemPropertiesWidget->
setItem( mScalebar );
222 connectUpdateSignal();
223 mFillSymbol1Button->registerExpressionContextGenerator( mScalebar );
224 mFillSymbol2Button->registerExpressionContextGenerator( mScalebar );
225 mLineStyleButton->registerExpressionContextGenerator( mScalebar );
226 mDivisionStyleButton->registerExpressionContextGenerator( mScalebar );
227 mSubdivisionStyleButton->registerExpressionContextGenerator( mScalebar );
235void QgsLayoutScaleBarWidget::lineSymbolChanged()
241 mScalebar->setLineSymbol( mLineStyleButton->clonedSymbol<
QgsLineSymbol>() );
243 mScalebar->layout()->undoStack()->endCommand();
246void QgsLayoutScaleBarWidget::divisionSymbolChanged()
252 mScalebar->setDivisionLineSymbol( mDivisionStyleButton->clonedSymbol<
QgsLineSymbol>() );
254 mScalebar->layout()->undoStack()->endCommand();
257void QgsLayoutScaleBarWidget::subdivisionSymbolChanged()
263 mScalebar->setSubdivisionLineSymbol( mSubdivisionStyleButton->clonedSymbol<
QgsLineSymbol>() );
265 mScalebar->layout()->undoStack()->endCommand();
268void QgsLayoutScaleBarWidget::fillSymbol1Changed()
274 mScalebar->setFillSymbol( mFillSymbol1Button->clonedSymbol<
QgsFillSymbol>() );
276 mScalebar->layout()->undoStack()->endCommand();
279void QgsLayoutScaleBarWidget::fillSymbol2Changed()
285 mScalebar->setAlternateFillSymbol( mFillSymbol2Button->clonedSymbol<
QgsFillSymbol>() );
287 mScalebar->layout()->undoStack()->endCommand();
290void QgsLayoutScaleBarWidget::setGuiElements()
297 blockMemberSignals(
true );
298 mNumberOfSegmentsSpinBox->setValue( mScalebar->numberOfSegments() );
299 mSegmentsLeftSpinBox->setValue( mScalebar->numberOfSegmentsLeft() );
300 mSegmentSizeSpinBox->setValue( mScalebar->unitsPerSegment() );
301 mHeightSpinBox->setValue( mScalebar->height() );
302 mNumberOfSubdivisionsSpinBox->setValue( mScalebar->numberOfSubdivisions() );
303 mSubdivisionsHeightSpinBox->setValue( mScalebar->subdivisionsHeight() );
304 mMapUnitsPerBarUnitSpinBox->setValue( mScalebar->mapUnitsPerScaleBarUnit() );
305 mLabelBarSpaceSpinBox->setValue( mScalebar->labelBarSpace() );
306 mBoxSizeSpinBox->setValue( mScalebar->boxContentSpace() );
307 mUnitLabelLineEdit->setText( mScalebar->unitLabel() );
308 mFontButton->setTextFormat( mScalebar->textFormat() );
310 whileBlocking( mLineStyleButton )->setSymbol( mScalebar->lineSymbol()->clone() );
311 whileBlocking( mDivisionStyleButton )->setSymbol( mScalebar->divisionLineSymbol()->clone() );
312 whileBlocking( mSubdivisionStyleButton )->setSymbol( mScalebar->subdivisionLineSymbol()->clone() );
313 whileBlocking( mFillSymbol1Button )->setSymbol( mScalebar->fillSymbol()->clone() );
314 whileBlocking( mFillSymbol2Button )->setSymbol( mScalebar->alternateFillSymbol()->clone() );
317 mMapItemComboBox->setItem( mScalebar->linkedMap() );
320 const QString style = mScalebar->style();
321 mStyleComboBox->setCurrentIndex( mStyleComboBox->findData( style ) );
322 toggleStyleSpecificControls( style );
325 mDistanceLabelPlacementComboBox->setCurrentIndex( mDistanceLabelPlacementComboBox->findData(
static_cast<int>(
326 distanceLabelPlacement( mScalebar->labelHorizontalPlacement(), mScalebar->labelVerticalPlacement() )
331 Qt::Alignment a = Qt::AlignLeft;
332 switch ( mScalebar->alignment() )
341 a = Qt::AlignHCenter;
344 mAlignmentComboBox->setCurrentAlignment( a );
347 mUnitsComboBox->setCurrentIndex( mUnitsComboBox->findData(
static_cast<int>( mScalebar->units() ) ) );
349 switch ( mScalebar->segmentSizeMode() )
353 mFixedSizeRadio->setChecked(
true );
354 mSegmentSizeWidget->setEnabled(
true );
355 mMinWidthWidget->setEnabled(
false );
356 mMaxWidthWidget->setEnabled(
false );
362 mFitWidthRadio->setChecked(
true );
363 mSegmentSizeWidget->setEnabled(
false );
364 mMinWidthWidget->setEnabled(
true );
365 mMaxWidthWidget->setEnabled(
true );
369 mMinWidthSpinBox->setValue( mScalebar->minimumBarWidth() );
370 mMaxWidthSpinBox->setValue( mScalebar->maximumBarWidth() );
372 mMethodCombo->setCurrentIndex( mMethodCombo->findData( QVariant::fromValue( mScalebar->method() ) ) );
374 populateDataDefinedButtons();
376 blockMemberSignals(
false );
381void QgsLayoutScaleBarWidget::mSegmentSizeSpinBox_valueChanged(
double d )
389 disconnectUpdateSignal();
390 mScalebar->setUnitsPerSegment( d );
392 connectUpdateSignal();
393 mScalebar->endCommand();
396void QgsLayoutScaleBarWidget::mSegmentsLeftSpinBox_valueChanged(
int i )
404 disconnectUpdateSignal();
405 mScalebar->setNumberOfSegmentsLeft( i );
407 connectUpdateSignal();
408 mScalebar->endCommand();
411void QgsLayoutScaleBarWidget::mNumberOfSegmentsSpinBox_valueChanged(
int i )
419 disconnectUpdateSignal();
420 mScalebar->setNumberOfSegments( i );
422 connectUpdateSignal();
423 mScalebar->endCommand();
426void QgsLayoutScaleBarWidget::mHeightSpinBox_valueChanged(
double d )
433 disconnectUpdateSignal();
434 mScalebar->setHeight( d );
436 connectUpdateSignal();
437 mScalebar->endCommand();
440void QgsLayoutScaleBarWidget::mNumberOfSubdivisionsSpinBox_valueChanged(
int i )
448 disconnectUpdateSignal();
449 mScalebar->setNumberOfSubdivisions( i );
451 connectUpdateSignal();
452 mScalebar->endCommand();
455void QgsLayoutScaleBarWidget::mSubdivisionsHeightSpinBox_valueChanged(
double d )
462 disconnectUpdateSignal();
463 mScalebar->setSubdivisionsHeight( d );
465 connectUpdateSignal();
466 mScalebar->endCommand();
469void QgsLayoutScaleBarWidget::textFormatChanged()
476 mScalebar->beginCommand( tr(
"Set Scalebar Font" ) );
477 disconnectUpdateSignal();
478 mScalebar->setTextFormat( mFontButton->textFormat() );
479 connectUpdateSignal();
480 mScalebar->endCommand();
484void QgsLayoutScaleBarWidget::changeNumberFormat()
493 widget->
setFormat( mScalebar->numericFormat() );
495 mScalebar->beginCommand( tr(
"Set Scalebar Number Format" ) );
496 disconnectUpdateSignal();
497 mScalebar->setNumericFormat( widget->
format() );
498 connectUpdateSignal();
499 mScalebar->endCommand();
508 switch ( horizontalPlacement )
511 switch ( verticalPlacement )
514 return DistanceLabelPlacement::CenteredAboveSegmentEdges;
516 return DistanceLabelPlacement::CenteredBelowSegmentEdges;
521 switch ( verticalPlacement )
524 return DistanceLabelPlacement::CenteredAboveSegmentCenters;
526 return DistanceLabelPlacement::CenteredBelowSegmentCenters;
533void QgsLayoutScaleBarWidget::mUnitLabelLineEdit_textChanged(
const QString &text )
541 disconnectUpdateSignal();
542 mScalebar->setUnitLabel( text );
544 connectUpdateSignal();
545 mScalebar->endCommand();
548void QgsLayoutScaleBarWidget::mMapUnitsPerBarUnitSpinBox_valueChanged(
double d )
556 disconnectUpdateSignal();
557 mScalebar->setMapUnitsPerScaleBarUnit( d );
559 connectUpdateSignal();
560 mScalebar->endCommand();
563void QgsLayoutScaleBarWidget::mStyleComboBox_currentIndexChanged(
const QString & )
570 const QString rendererId = mStyleComboBox->currentData().toString();
571 if ( rendererId == mScalebar->style() )
574 mScalebar->beginCommand( tr(
"Set Scalebar Style" ) );
575 disconnectUpdateSignal();
577 bool defaultsApplied =
false;
580 defaultsApplied = mScalebar->applyDefaultRendererSettings( renderer.get() );
583 toggleStyleSpecificControls( rendererId );
585 mScalebar->setStyle( rendererId );
587 connectUpdateSignal();
588 mScalebar->endCommand();
590 if ( defaultsApplied )
594void QgsLayoutScaleBarWidget::toggleStyleSpecificControls(
const QString &style )
610 if ( !mGroupBoxUnits->isEnabled() )
611 mGroupBoxSegments->setCollapsed(
true );
630void QgsLayoutScaleBarWidget::mLabelBarSpaceSpinBox_valueChanged(
double d )
638 disconnectUpdateSignal();
639 mScalebar->setLabelBarSpace( d );
641 connectUpdateSignal();
642 mScalebar->endCommand();
645void QgsLayoutScaleBarWidget::mBoxSizeSpinBox_valueChanged(
double d )
653 disconnectUpdateSignal();
654 mScalebar->setBoxContentSpace( d );
656 connectUpdateSignal();
657 mScalebar->endCommand();
660void QgsLayoutScaleBarWidget::mDistanceLabelPlacementComboBox_currentIndexChanged(
int index )
667 mScalebar->beginCommand( tr(
"Set Scalebar Label Placement" ) );
668 disconnectUpdateSignal();
670 const DistanceLabelPlacement placement =
static_cast<DistanceLabelPlacement
>( mDistanceLabelPlacementComboBox->itemData( index ).toInt() );
673 case DistanceLabelPlacement::CenteredAboveSegmentEdges:
677 case DistanceLabelPlacement::CenteredAboveSegmentCenters:
681 case DistanceLabelPlacement::CenteredBelowSegmentEdges:
685 case DistanceLabelPlacement::CenteredBelowSegmentCenters:
692 connectUpdateSignal();
693 mScalebar->endCommand();
696void QgsLayoutScaleBarWidget::alignmentChanged()
703 mScalebar->beginCommand( tr(
"Set Scalebar Alignment" ) );
704 disconnectUpdateSignal();
709 mScalebar->setAlignment( a );
711 connectUpdateSignal();
712 mScalebar->endCommand();
715void QgsLayoutScaleBarWidget::mUnitsComboBox_currentIndexChanged(
int index )
722 const QVariant unitData = mUnitsComboBox->itemData( index );
723 if ( unitData.userType() == QMetaType::Type::UnknownType )
728 disconnectUpdateSignal();
729 mScalebar->beginCommand( tr(
"Set Scalebar Units" ) );
733 mNumberOfSegmentsSpinBox->setValue( mScalebar->numberOfSegments() );
734 mSegmentsLeftSpinBox->setValue( mScalebar->numberOfSegmentsLeft() );
735 mUnitLabelLineEdit->setText( mScalebar->unitLabel() );
736 mSegmentSizeSpinBox->setValue( mScalebar->unitsPerSegment() );
737 mMapUnitsPerBarUnitSpinBox->setValue( mScalebar->mapUnitsPerScaleBarUnit() );
739 connectUpdateSignal();
740 mScalebar->endCommand();
743void QgsLayoutScaleBarWidget::blockMemberSignals(
bool block )
745 mSegmentSizeSpinBox->blockSignals( block );
746 mNumberOfSegmentsSpinBox->blockSignals( block );
747 mSegmentsLeftSpinBox->blockSignals( block );
748 mNumberOfSubdivisionsSpinBox->blockSignals( block );
749 mSubdivisionsHeightSpinBox->blockSignals( block );
750 mStyleComboBox->blockSignals( block );
751 mUnitLabelLineEdit->blockSignals( block );
752 mMapUnitsPerBarUnitSpinBox->blockSignals( block );
753 mHeightSpinBox->blockSignals( block );
754 mLineStyleButton->blockSignals( block );
755 mDivisionStyleButton->blockSignals( block );
756 mSubdivisionStyleButton->blockSignals( block );
757 mLabelBarSpaceSpinBox->blockSignals( block );
758 mBoxSizeSpinBox->blockSignals( block );
759 mDistanceLabelPlacementComboBox->blockSignals( block );
760 mAlignmentComboBox->blockSignals( block );
761 mUnitsComboBox->blockSignals( block );
762 mFillSymbol1Button->blockSignals( block );
763 mFillSymbol2Button->blockSignals( block );
764 mSegmentSizeRadioGroup.blockSignals( block );
765 mMapItemComboBox->blockSignals( block );
766 mFontButton->blockSignals( block );
767 mMinWidthSpinBox->blockSignals( block );
768 mMaxWidthSpinBox->blockSignals( block );
769 mMethodCombo->blockSignals( block );
772void QgsLayoutScaleBarWidget::connectUpdateSignal()
780void QgsLayoutScaleBarWidget::disconnectUpdateSignal()
788void QgsLayoutScaleBarWidget::segmentSizeRadioChanged( QAbstractButton *radio )
790 const bool fixedSizeMode = radio == mFixedSizeRadio;
791 mMinWidthWidget->setEnabled( !fixedSizeMode );
792 mMaxWidthWidget->setEnabled( !fixedSizeMode );
793 mSegmentSizeWidget->setEnabled( fixedSizeMode );
801 disconnectUpdateSignal();
802 if ( mFixedSizeRadio->isChecked() )
805 mScalebar->setUnitsPerSegment( mSegmentSizeSpinBox->value() );
812 connectUpdateSignal();
813 mScalebar->endCommand();
816void QgsLayoutScaleBarWidget::mapChanged(
QgsLayoutItem *item )
825 mScalebar->beginCommand( tr(
"Set Scalebar Map" ) );
826 disconnectUpdateSignal();
827 mScalebar->setLinkedMap( map );
829 connectUpdateSignal();
830 mScalebar->endCommand();
833void QgsLayoutScaleBarWidget::mMinWidthSpinBox_valueChanged(
double )
841 disconnectUpdateSignal();
842 mScalebar->setMinimumBarWidth( mMinWidthSpinBox->value() );
844 connectUpdateSignal();
845 mScalebar->endCommand();
848void QgsLayoutScaleBarWidget::mMaxWidthSpinBox_valueChanged(
double )
856 disconnectUpdateSignal();
857 mScalebar->setMaximumBarWidth( mMaxWidthSpinBox->value() );
859 connectUpdateSignal();
860 mScalebar->endCommand();
863void 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.
ScaleCalculationMethod
Scale calculation logic.
@ HorizontalTop
Calculate horizontally, across top of map.
@ HorizontalMiddle
Calculate horizontally, across midle of map.
@ HorizontalAverage
Calculate horizontally, using the average of the top, middle and bottom scales.
@ HorizontalBottom
Calculate horizontally, across bottom of map.
@ 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.