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, [ = ]
66 disconnectUpdateSignal();
67 mScalebar->beginCommand( tr(
"Set Scalebar Method" ) );
70 connectUpdateSignal();
71 mScalebar->endCommand();
83 mSegmentsLeftDDBtn->registerEnabledWidget( mSegmentsLeftSpinBox,
false );
84 mSegmentsRightDDBtn->registerEnabledWidget( mNumberOfSegmentsSpinBox,
false );
85 mSegmentSizeDDBtn->registerEnabledWidget( mSegmentSizeSpinBox,
false );
86 mMinWidthDDBtn->registerEnabledWidget( mMinWidthSpinBox,
false );
87 mMaxWidthDDBtn->registerEnabledWidget( mMaxWidthSpinBox,
false );
91 mFontButton->registerExpressionContextGenerator(
this );
93 connectUpdateSignal();
97 mainLayout->addWidget( mItemPropertiesWidget );
99 mSegmentSizeRadioGroup.addButton( mFixedSizeRadio );
100 mSegmentSizeRadioGroup.addButton( mFitWidthRadio );
101 connect( &mSegmentSizeRadioGroup,
static_cast < void ( QButtonGroup::* )( QAbstractButton * )
> ( &QButtonGroup::buttonClicked ),
this, &QgsLayoutScaleBarWidget::segmentSizeRadioChanged );
103 blockMemberSignals(
true );
107 for (
const QString &renderer : renderers )
113 mDistanceLabelPlacementComboBox->addItem( tr(
"Above Segment Edges" ),
static_cast< int >( DistanceLabelPlacement::CenteredAboveSegmentEdges ) );
114 mDistanceLabelPlacementComboBox->addItem( tr(
"Above Segment Centers" ),
static_cast< int >( DistanceLabelPlacement::CenteredAboveSegmentCenters ) );
115 mDistanceLabelPlacementComboBox->addItem( tr(
"Below Segment Edges" ),
static_cast< int >( DistanceLabelPlacement::CenteredBelowSegmentEdges ) );
116 mDistanceLabelPlacementComboBox->addItem( tr(
"Below Segment Centers" ),
static_cast< int >( DistanceLabelPlacement::CenteredBelowSegmentCenters ) );
119 mAlignmentComboBox->setAvailableAlignments( Qt::AlignLeft | Qt::AlignHCenter | Qt::AlignRight );
145 connect( mSubdivisionStyleButton, &
QgsSymbolButton::changed,
this, &QgsLayoutScaleBarWidget::subdivisionSymbolChanged );
153 mFontButton->setDialogTitle( tr(
"Scalebar Font" ) );
158 QgsLayout *scaleBarLayout = mScalebar->layout();
159 if ( scaleBarLayout )
161 mMapItemComboBox->setCurrentLayout( scaleBarLayout );
168 blockMemberSignals(
false );
171 mLineStyleButton->registerExpressionContextGenerator( mScalebar );
173 mDivisionStyleButton->registerExpressionContextGenerator( mScalebar );
175 mSubdivisionStyleButton->registerExpressionContextGenerator( mScalebar );
177 mFillSymbol1Button->registerExpressionContextGenerator( mScalebar );
179 mFillSymbol2Button->registerExpressionContextGenerator( mScalebar );
184 if ( mScalebar->layout() )
197 if ( mItemPropertiesWidget )
216 disconnectUpdateSignal();
218 mScalebar = qobject_cast< QgsLayoutItemScaleBar * >( item );
219 mItemPropertiesWidget->
setItem( mScalebar );
223 connectUpdateSignal();
224 mFillSymbol1Button->registerExpressionContextGenerator( mScalebar );
225 mFillSymbol2Button->registerExpressionContextGenerator( mScalebar );
226 mLineStyleButton->registerExpressionContextGenerator( mScalebar );
227 mDivisionStyleButton->registerExpressionContextGenerator( mScalebar );
228 mSubdivisionStyleButton->registerExpressionContextGenerator( mScalebar );
236void QgsLayoutScaleBarWidget::lineSymbolChanged()
242 mScalebar->setLineSymbol( mLineStyleButton->clonedSymbol<
QgsLineSymbol>() );
244 mScalebar->layout()->undoStack()->endCommand();
247void QgsLayoutScaleBarWidget::divisionSymbolChanged()
253 mScalebar->setDivisionLineSymbol( mDivisionStyleButton->clonedSymbol<
QgsLineSymbol>() );
255 mScalebar->layout()->undoStack()->endCommand();
258void QgsLayoutScaleBarWidget::subdivisionSymbolChanged()
264 mScalebar->setSubdivisionLineSymbol( mSubdivisionStyleButton->clonedSymbol<
QgsLineSymbol>() );
266 mScalebar->layout()->undoStack()->endCommand();
269void QgsLayoutScaleBarWidget::fillSymbol1Changed()
275 mScalebar->setFillSymbol( mFillSymbol1Button->clonedSymbol<
QgsFillSymbol>() );
277 mScalebar->layout()->undoStack()->endCommand();
280void QgsLayoutScaleBarWidget::fillSymbol2Changed()
286 mScalebar->setAlternateFillSymbol( mFillSymbol2Button->clonedSymbol<
QgsFillSymbol>() );
288 mScalebar->layout()->undoStack()->endCommand();
291void QgsLayoutScaleBarWidget::setGuiElements()
298 blockMemberSignals(
true );
299 mNumberOfSegmentsSpinBox->setValue( mScalebar->numberOfSegments() );
300 mSegmentsLeftSpinBox->setValue( mScalebar->numberOfSegmentsLeft() );
301 mSegmentSizeSpinBox->setValue( mScalebar->unitsPerSegment() );
302 mHeightSpinBox->setValue( mScalebar->height() );
303 mNumberOfSubdivisionsSpinBox->setValue( mScalebar->numberOfSubdivisions() );
304 mSubdivisionsHeightSpinBox->setValue( mScalebar->subdivisionsHeight() );
305 mMapUnitsPerBarUnitSpinBox->setValue( mScalebar->mapUnitsPerScaleBarUnit() );
306 mLabelBarSpaceSpinBox->setValue( mScalebar->labelBarSpace() );
307 mBoxSizeSpinBox->setValue( mScalebar->boxContentSpace() );
308 mUnitLabelLineEdit->setText( mScalebar->unitLabel() );
309 mFontButton->setTextFormat( mScalebar->textFormat() );
311 whileBlocking( mLineStyleButton )->setSymbol( mScalebar->lineSymbol()->clone() );
312 whileBlocking( mDivisionStyleButton )->setSymbol( mScalebar->divisionLineSymbol()->clone() );
313 whileBlocking( mSubdivisionStyleButton )->setSymbol( mScalebar->subdivisionLineSymbol()->clone() );
314 whileBlocking( mFillSymbol1Button )->setSymbol( mScalebar->fillSymbol()->clone() );
315 whileBlocking( mFillSymbol2Button )->setSymbol( mScalebar->alternateFillSymbol()->clone() );
318 mMapItemComboBox->setItem( mScalebar->linkedMap() );
321 const QString style = mScalebar->style();
322 mStyleComboBox->setCurrentIndex( mStyleComboBox->findData( style ) );
323 toggleStyleSpecificControls( style );
326 mDistanceLabelPlacementComboBox->setCurrentIndex( mDistanceLabelPlacementComboBox->findData(
static_cast< int >(
327 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() );
496 mScalebar->beginCommand( tr(
"Set Scalebar Number Format" ) );
497 disconnectUpdateSignal();
498 mScalebar->setNumericFormat( widget->
format() );
499 connectUpdateSignal();
500 mScalebar->endCommand();
509 switch ( horizontalPlacement )
512 switch ( verticalPlacement )
515 return DistanceLabelPlacement::CenteredAboveSegmentEdges;
517 return DistanceLabelPlacement::CenteredBelowSegmentEdges;
522 switch ( verticalPlacement )
525 return DistanceLabelPlacement::CenteredAboveSegmentCenters;
527 return DistanceLabelPlacement::CenteredBelowSegmentCenters;
534void QgsLayoutScaleBarWidget::mUnitLabelLineEdit_textChanged(
const QString &text )
542 disconnectUpdateSignal();
543 mScalebar->setUnitLabel( text );
545 connectUpdateSignal();
546 mScalebar->endCommand();
549void QgsLayoutScaleBarWidget::mMapUnitsPerBarUnitSpinBox_valueChanged(
double d )
557 disconnectUpdateSignal();
558 mScalebar->setMapUnitsPerScaleBarUnit( d );
560 connectUpdateSignal();
561 mScalebar->endCommand();
564void QgsLayoutScaleBarWidget::mStyleComboBox_currentIndexChanged(
const QString & )
571 const QString rendererId = mStyleComboBox->currentData().toString();
572 if ( rendererId == mScalebar->style() )
575 mScalebar->beginCommand( tr(
"Set Scalebar Style" ) );
576 disconnectUpdateSignal();
578 bool defaultsApplied =
false;
581 defaultsApplied = mScalebar->applyDefaultRendererSettings( renderer.get() );
584 toggleStyleSpecificControls( rendererId );
586 mScalebar->setStyle( rendererId );
588 connectUpdateSignal();
589 mScalebar->endCommand();
591 if ( defaultsApplied )
595void QgsLayoutScaleBarWidget::toggleStyleSpecificControls(
const QString &style )
611 if ( !mGroupBoxUnits->isEnabled() )
612 mGroupBoxSegments->setCollapsed(
true );
632void QgsLayoutScaleBarWidget::mLabelBarSpaceSpinBox_valueChanged(
double d )
640 disconnectUpdateSignal();
641 mScalebar->setLabelBarSpace( d );
643 connectUpdateSignal();
644 mScalebar->endCommand();
647void QgsLayoutScaleBarWidget::mBoxSizeSpinBox_valueChanged(
double d )
655 disconnectUpdateSignal();
656 mScalebar->setBoxContentSpace( d );
658 connectUpdateSignal();
659 mScalebar->endCommand();
662void QgsLayoutScaleBarWidget::mDistanceLabelPlacementComboBox_currentIndexChanged(
int index )
669 mScalebar->beginCommand( tr(
"Set Scalebar Label Placement" ) );
670 disconnectUpdateSignal();
672 const DistanceLabelPlacement placement =
static_cast<DistanceLabelPlacement
>( mDistanceLabelPlacementComboBox->itemData( index ).toInt() );
675 case DistanceLabelPlacement::CenteredAboveSegmentEdges:
679 case DistanceLabelPlacement::CenteredAboveSegmentCenters:
683 case DistanceLabelPlacement::CenteredBelowSegmentEdges:
687 case DistanceLabelPlacement::CenteredBelowSegmentCenters:
694 connectUpdateSignal();
695 mScalebar->endCommand();
698void QgsLayoutScaleBarWidget::alignmentChanged()
705 mScalebar->beginCommand( tr(
"Set Scalebar Alignment" ) );
706 disconnectUpdateSignal();
710 mScalebar->setAlignment( a );
712 connectUpdateSignal();
713 mScalebar->endCommand();
716void QgsLayoutScaleBarWidget::mUnitsComboBox_currentIndexChanged(
int index )
723 const QVariant unitData = mUnitsComboBox->itemData( index );
724 if ( unitData.userType() == QMetaType::Type::UnknownType )
729 disconnectUpdateSignal();
730 mScalebar->beginCommand( tr(
"Set Scalebar Units" ) );
734 mNumberOfSegmentsSpinBox->setValue( mScalebar->numberOfSegments() );
735 mSegmentsLeftSpinBox->setValue( mScalebar->numberOfSegmentsLeft() );
736 mUnitLabelLineEdit->setText( mScalebar->unitLabel() );
737 mSegmentSizeSpinBox->setValue( mScalebar->unitsPerSegment() );
738 mMapUnitsPerBarUnitSpinBox->setValue( mScalebar->mapUnitsPerScaleBarUnit() );
740 connectUpdateSignal();
741 mScalebar->endCommand();
744void QgsLayoutScaleBarWidget::blockMemberSignals(
bool block )
746 mSegmentSizeSpinBox->blockSignals( block );
747 mNumberOfSegmentsSpinBox->blockSignals( block );
748 mSegmentsLeftSpinBox->blockSignals( block );
749 mNumberOfSubdivisionsSpinBox->blockSignals( block );
750 mSubdivisionsHeightSpinBox->blockSignals( block );
751 mStyleComboBox->blockSignals( block );
752 mUnitLabelLineEdit->blockSignals( block );
753 mMapUnitsPerBarUnitSpinBox->blockSignals( block );
754 mHeightSpinBox->blockSignals( block );
755 mLineStyleButton->blockSignals( block );
756 mDivisionStyleButton->blockSignals( block );
757 mSubdivisionStyleButton->blockSignals( block );
758 mLabelBarSpaceSpinBox->blockSignals( block );
759 mBoxSizeSpinBox->blockSignals( block );
760 mDistanceLabelPlacementComboBox->blockSignals( block );
761 mAlignmentComboBox->blockSignals( block );
762 mUnitsComboBox->blockSignals( block );
763 mFillSymbol1Button->blockSignals( block );
764 mFillSymbol2Button->blockSignals( block );
765 mSegmentSizeRadioGroup.blockSignals( block );
766 mMapItemComboBox->blockSignals( block );
767 mFontButton->blockSignals( block );
768 mMinWidthSpinBox->blockSignals( block );
769 mMaxWidthSpinBox->blockSignals( block );
770 mMethodCombo->blockSignals( block );
773void QgsLayoutScaleBarWidget::connectUpdateSignal()
781void QgsLayoutScaleBarWidget::disconnectUpdateSignal()
789void QgsLayoutScaleBarWidget::segmentSizeRadioChanged( QAbstractButton *radio )
791 const bool fixedSizeMode = radio == mFixedSizeRadio;
792 mMinWidthWidget->setEnabled( !fixedSizeMode );
793 mMaxWidthWidget->setEnabled( !fixedSizeMode );
794 mSegmentSizeWidget->setEnabled( fixedSizeMode );
802 disconnectUpdateSignal();
803 if ( mFixedSizeRadio->isChecked() )
806 mScalebar->setUnitsPerSegment( mSegmentSizeSpinBox->value() );
813 connectUpdateSignal();
814 mScalebar->endCommand();
817void QgsLayoutScaleBarWidget::mapChanged(
QgsLayoutItem *item )
826 mScalebar->beginCommand( tr(
"Set Scalebar Map" ) );
827 disconnectUpdateSignal();
828 mScalebar->setLinkedMap( map );
830 connectUpdateSignal();
831 mScalebar->endCommand();
834void QgsLayoutScaleBarWidget::mMinWidthSpinBox_valueChanged(
double )
842 disconnectUpdateSignal();
843 mScalebar->setMinimumBarWidth( mMinWidthSpinBox->value() );
845 connectUpdateSignal();
846 mScalebar->endCommand();
849void QgsLayoutScaleBarWidget::mMaxWidthSpinBox_valueChanged(
double )
857 disconnectUpdateSignal();
858 mScalebar->setMaximumBarWidth( mMaxWidthSpinBox->value() );
860 connectUpdateSignal();
861 mScalebar->endCommand();
864void 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.