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 );
58 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() ) ) ) );
330 Qt::Alignment a = Qt::AlignLeft;
331 switch ( mScalebar->alignment() )
340 a = Qt::AlignHCenter;
343 mAlignmentComboBox->setCurrentAlignment( a );
346 mUnitsComboBox->setCurrentIndex( mUnitsComboBox->findData(
static_cast< int >( mScalebar->units() ) ) );
348 switch ( mScalebar->segmentSizeMode() )
352 mFixedSizeRadio->setChecked(
true );
353 mSegmentSizeWidget->setEnabled(
true );
354 mMinWidthWidget->setEnabled(
false );
355 mMaxWidthWidget->setEnabled(
false );
361 mFitWidthRadio->setChecked(
true );
362 mSegmentSizeWidget->setEnabled(
false );
363 mMinWidthWidget->setEnabled(
true );
364 mMaxWidthWidget->setEnabled(
true );
368 mMinWidthSpinBox->setValue( mScalebar->minimumBarWidth() );
369 mMaxWidthSpinBox->setValue( mScalebar->maximumBarWidth() );
371 mMethodCombo->setCurrentIndex( mMethodCombo->findData( QVariant::fromValue( mScalebar->method() ) ) );
373 populateDataDefinedButtons();
375 blockMemberSignals(
false );
380void QgsLayoutScaleBarWidget::mSegmentSizeSpinBox_valueChanged(
double d )
388 disconnectUpdateSignal();
389 mScalebar->setUnitsPerSegment( d );
391 connectUpdateSignal();
392 mScalebar->endCommand();
395void QgsLayoutScaleBarWidget::mSegmentsLeftSpinBox_valueChanged(
int i )
403 disconnectUpdateSignal();
404 mScalebar->setNumberOfSegmentsLeft( i );
406 connectUpdateSignal();
407 mScalebar->endCommand();
410void QgsLayoutScaleBarWidget::mNumberOfSegmentsSpinBox_valueChanged(
int i )
418 disconnectUpdateSignal();
419 mScalebar->setNumberOfSegments( i );
421 connectUpdateSignal();
422 mScalebar->endCommand();
425void QgsLayoutScaleBarWidget::mHeightSpinBox_valueChanged(
double d )
432 disconnectUpdateSignal();
433 mScalebar->setHeight( d );
435 connectUpdateSignal();
436 mScalebar->endCommand();
439void QgsLayoutScaleBarWidget::mNumberOfSubdivisionsSpinBox_valueChanged(
int i )
447 disconnectUpdateSignal();
448 mScalebar->setNumberOfSubdivisions( i );
450 connectUpdateSignal();
451 mScalebar->endCommand();
454void QgsLayoutScaleBarWidget::mSubdivisionsHeightSpinBox_valueChanged(
double d )
461 disconnectUpdateSignal();
462 mScalebar->setSubdivisionsHeight( d );
464 connectUpdateSignal();
465 mScalebar->endCommand();
468void QgsLayoutScaleBarWidget::textFormatChanged()
475 mScalebar->beginCommand( tr(
"Set Scalebar Font" ) );
476 disconnectUpdateSignal();
477 mScalebar->setTextFormat( mFontButton->textFormat() );
478 connectUpdateSignal();
479 mScalebar->endCommand();
483void QgsLayoutScaleBarWidget::changeNumberFormat()
492 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 );
631void QgsLayoutScaleBarWidget::mLabelBarSpaceSpinBox_valueChanged(
double d )
639 disconnectUpdateSignal();
640 mScalebar->setLabelBarSpace( d );
642 connectUpdateSignal();
643 mScalebar->endCommand();
646void QgsLayoutScaleBarWidget::mBoxSizeSpinBox_valueChanged(
double d )
654 disconnectUpdateSignal();
655 mScalebar->setBoxContentSpace( d );
657 connectUpdateSignal();
658 mScalebar->endCommand();
661void QgsLayoutScaleBarWidget::mDistanceLabelPlacementComboBox_currentIndexChanged(
int index )
668 mScalebar->beginCommand( tr(
"Set Scalebar Label Placement" ) );
669 disconnectUpdateSignal();
671 const DistanceLabelPlacement placement =
static_cast<DistanceLabelPlacement
>( mDistanceLabelPlacementComboBox->itemData( index ).toInt() );
674 case DistanceLabelPlacement::CenteredAboveSegmentEdges:
678 case DistanceLabelPlacement::CenteredAboveSegmentCenters:
682 case DistanceLabelPlacement::CenteredBelowSegmentEdges:
686 case DistanceLabelPlacement::CenteredBelowSegmentCenters:
693 connectUpdateSignal();
694 mScalebar->endCommand();
697void QgsLayoutScaleBarWidget::alignmentChanged()
704 mScalebar->beginCommand( tr(
"Set Scalebar Alignment" ) );
705 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.