29 #include <QColorDialog>
30 #include <QFontDialog>
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( mLabelVerticalPlacementComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutScaleBarWidget::mLabelVerticalPlacementComboBox_currentIndexChanged );
54 connect( mLabelHorizontalPlacementComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutScaleBarWidget::mLabelHorizontalPlacementComboBox_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 );
61 mFontButton->registerExpressionContextGenerator(
this );
63 connectUpdateSignal();
67 mainLayout->addWidget( mItemPropertiesWidget );
69 mSegmentSizeRadioGroup.addButton( mFixedSizeRadio );
70 mSegmentSizeRadioGroup.addButton( mFitWidthRadio );
71 connect( &mSegmentSizeRadioGroup,
static_cast < void ( QButtonGroup::* )( QAbstractButton * )
> ( &QButtonGroup::buttonClicked ),
this, &QgsLayoutScaleBarWidget::segmentSizeRadioChanged );
73 blockMemberSignals(
true );
77 for (
const QString &renderer : renderers )
89 mAlignmentComboBox->setAvailableAlignments( Qt::AlignLeft | Qt::AlignHCenter | Qt::AlignRight );
109 connect( mSubdivisionStyleButton, &
QgsSymbolButton::changed,
this, &QgsLayoutScaleBarWidget::subdivisionSymbolChanged );
117 mFontButton->setDialogTitle( tr(
"Scalebar Font" ) );
122 QgsLayout *scaleBarLayout = mScalebar->layout();
123 if ( scaleBarLayout )
125 mMapItemComboBox->setCurrentLayout( scaleBarLayout );
132 blockMemberSignals(
false );
135 mLineStyleButton->registerExpressionContextGenerator( mScalebar );
137 mDivisionStyleButton->registerExpressionContextGenerator( mScalebar );
139 mSubdivisionStyleButton->registerExpressionContextGenerator( mScalebar );
141 mFillSymbol1Button->registerExpressionContextGenerator( mScalebar );
143 mFillSymbol2Button->registerExpressionContextGenerator( mScalebar );
148 if ( mScalebar->layout() )
161 if ( mItemPropertiesWidget )
180 disconnectUpdateSignal();
182 mScalebar = qobject_cast< QgsLayoutItemScaleBar * >( item );
183 mItemPropertiesWidget->
setItem( mScalebar );
187 connectUpdateSignal();
188 mFillSymbol1Button->registerExpressionContextGenerator( mScalebar );
189 mFillSymbol2Button->registerExpressionContextGenerator( mScalebar );
190 mLineStyleButton->registerExpressionContextGenerator( mScalebar );
191 mDivisionStyleButton->registerExpressionContextGenerator( mScalebar );
192 mSubdivisionStyleButton->registerExpressionContextGenerator( mScalebar );
200 void QgsLayoutScaleBarWidget::lineSymbolChanged()
206 mScalebar->setLineSymbol( mLineStyleButton->clonedSymbol<
QgsLineSymbol>() );
208 mScalebar->layout()->undoStack()->endCommand();
211 void QgsLayoutScaleBarWidget::divisionSymbolChanged()
217 mScalebar->setDivisionLineSymbol( mDivisionStyleButton->clonedSymbol<
QgsLineSymbol>() );
219 mScalebar->layout()->undoStack()->endCommand();
222 void QgsLayoutScaleBarWidget::subdivisionSymbolChanged()
228 mScalebar->setSubdivisionLineSymbol( mSubdivisionStyleButton->clonedSymbol<
QgsLineSymbol>() );
230 mScalebar->layout()->undoStack()->endCommand();
233 void QgsLayoutScaleBarWidget::fillSymbol1Changed()
239 mScalebar->setFillSymbol( mFillSymbol1Button->clonedSymbol<
QgsFillSymbol>() );
241 mScalebar->layout()->undoStack()->endCommand();
244 void QgsLayoutScaleBarWidget::fillSymbol2Changed()
250 mScalebar->setAlternateFillSymbol( mFillSymbol2Button->clonedSymbol<
QgsFillSymbol>() );
252 mScalebar->layout()->undoStack()->endCommand();
255 void QgsLayoutScaleBarWidget::setGuiElements()
262 blockMemberSignals(
true );
263 mNumberOfSegmentsSpinBox->setValue( mScalebar->numberOfSegments() );
264 mSegmentsLeftSpinBox->setValue( mScalebar->numberOfSegmentsLeft() );
265 mSegmentSizeSpinBox->setValue( mScalebar->unitsPerSegment() );
266 mHeightSpinBox->setValue( mScalebar->height() );
267 mNumberOfSubdivisionsSpinBox->setValue( mScalebar->numberOfSubdivisions() );
268 mSubdivisionsHeightSpinBox->setValue( mScalebar->subdivisionsHeight() );
269 mMapUnitsPerBarUnitSpinBox->setValue( mScalebar->mapUnitsPerScaleBarUnit() );
270 mLabelBarSpaceSpinBox->setValue( mScalebar->labelBarSpace() );
271 mBoxSizeSpinBox->setValue( mScalebar->boxContentSpace() );
272 mUnitLabelLineEdit->setText( mScalebar->unitLabel() );
273 mFontButton->setTextFormat( mScalebar->textFormat() );
275 whileBlocking( mLineStyleButton )->setSymbol( mScalebar->lineSymbol()->clone() );
276 whileBlocking( mDivisionStyleButton )->setSymbol( mScalebar->divisionLineSymbol()->clone() );
277 whileBlocking( mSubdivisionStyleButton )->setSymbol( mScalebar->subdivisionLineSymbol()->clone() );
278 whileBlocking( mFillSymbol1Button )->setSymbol( mScalebar->fillSymbol()->clone() );
279 whileBlocking( mFillSymbol2Button )->setSymbol( mScalebar->alternateFillSymbol()->clone() );
282 mMapItemComboBox->setItem( mScalebar->linkedMap() );
285 const QString style = mScalebar->style();
286 mStyleComboBox->setCurrentIndex( mStyleComboBox->findData( style ) );
287 toggleStyleSpecificControls( style );
290 mLabelVerticalPlacementComboBox->setCurrentIndex( mLabelVerticalPlacementComboBox->findData(
static_cast< int >( mScalebar->labelVerticalPlacement() ) ) );
291 mLabelHorizontalPlacementComboBox->setCurrentIndex( mLabelHorizontalPlacementComboBox->findData(
static_cast< int >( mScalebar->labelHorizontalPlacement() ) ) );
295 Qt::Alignment a = Qt::AlignLeft;
296 switch ( mScalebar->alignment() )
305 a = Qt::AlignHCenter;
308 mAlignmentComboBox->setCurrentAlignment( a );
311 mUnitsComboBox->setCurrentIndex( mUnitsComboBox->findData(
static_cast< int >( mScalebar->units() ) ) );
315 mFixedSizeRadio->setChecked(
true );
316 mSegmentSizeSpinBox->setEnabled(
true );
317 mMinWidthSpinBox->setEnabled(
false );
318 mMaxWidthSpinBox->setEnabled(
false );
322 mFitWidthRadio->setChecked(
true );
323 mSegmentSizeSpinBox->setEnabled(
false );
324 mMinWidthSpinBox->setEnabled(
true );
325 mMaxWidthSpinBox->setEnabled(
true );
327 mMinWidthSpinBox->setValue( mScalebar->minimumBarWidth() );
328 mMaxWidthSpinBox->setValue( mScalebar->maximumBarWidth() );
329 blockMemberSignals(
false );
334 void QgsLayoutScaleBarWidget::mSegmentSizeSpinBox_valueChanged(
double d )
342 disconnectUpdateSignal();
343 mScalebar->setUnitsPerSegment( d );
345 connectUpdateSignal();
346 mScalebar->endCommand();
349 void QgsLayoutScaleBarWidget::mSegmentsLeftSpinBox_valueChanged(
int i )
357 disconnectUpdateSignal();
358 mScalebar->setNumberOfSegmentsLeft( i );
360 connectUpdateSignal();
361 mScalebar->endCommand();
364 void QgsLayoutScaleBarWidget::mNumberOfSegmentsSpinBox_valueChanged(
int i )
372 disconnectUpdateSignal();
373 mScalebar->setNumberOfSegments( i );
375 connectUpdateSignal();
376 mScalebar->endCommand();
379 void QgsLayoutScaleBarWidget::mHeightSpinBox_valueChanged(
double d )
386 disconnectUpdateSignal();
387 mScalebar->setHeight( d );
389 connectUpdateSignal();
390 mScalebar->endCommand();
393 void QgsLayoutScaleBarWidget::mNumberOfSubdivisionsSpinBox_valueChanged(
int i )
401 disconnectUpdateSignal();
402 mScalebar->setNumberOfSubdivisions( i );
404 connectUpdateSignal();
405 mScalebar->endCommand();
408 void QgsLayoutScaleBarWidget::mSubdivisionsHeightSpinBox_valueChanged(
double d )
415 disconnectUpdateSignal();
416 mScalebar->setSubdivisionsHeight( d );
418 connectUpdateSignal();
419 mScalebar->endCommand();
422 void QgsLayoutScaleBarWidget::textFormatChanged()
429 mScalebar->beginCommand( tr(
"Set Scalebar Font" ) );
430 disconnectUpdateSignal();
431 mScalebar->setTextFormat( mFontButton->textFormat() );
432 connectUpdateSignal();
433 mScalebar->endCommand();
437 void QgsLayoutScaleBarWidget::changeNumberFormat()
446 widget->
setFormat( mScalebar->numericFormat() );
449 mScalebar->beginCommand( tr(
"Set Scalebar Number Format" ) );
450 disconnectUpdateSignal();
451 mScalebar->setNumericFormat( widget->
format() );
452 connectUpdateSignal();
453 mScalebar->endCommand();
460 void QgsLayoutScaleBarWidget::mUnitLabelLineEdit_textChanged(
const QString &text )
468 disconnectUpdateSignal();
469 mScalebar->setUnitLabel( text );
471 connectUpdateSignal();
472 mScalebar->endCommand();
475 void QgsLayoutScaleBarWidget::mMapUnitsPerBarUnitSpinBox_valueChanged(
double d )
483 disconnectUpdateSignal();
484 mScalebar->setMapUnitsPerScaleBarUnit( d );
486 connectUpdateSignal();
487 mScalebar->endCommand();
490 void QgsLayoutScaleBarWidget::mStyleComboBox_currentIndexChanged(
const QString & )
497 const QString rendererId = mStyleComboBox->currentData().toString();
498 if ( rendererId == mScalebar->style() )
501 mScalebar->beginCommand( tr(
"Set Scalebar Style" ) );
502 disconnectUpdateSignal();
504 bool defaultsApplied =
false;
507 defaultsApplied = mScalebar->applyDefaultRendererSettings( renderer.get() );
510 toggleStyleSpecificControls( rendererId );
512 mScalebar->setStyle( rendererId );
514 connectUpdateSignal();
515 mScalebar->endCommand();
517 if ( defaultsApplied )
521 void QgsLayoutScaleBarWidget::toggleStyleSpecificControls(
const QString &style )
537 if ( !mGroupBoxUnits->isEnabled() )
538 mGroupBoxSegments->setCollapsed(
true );
559 void QgsLayoutScaleBarWidget::mLabelBarSpaceSpinBox_valueChanged(
double d )
567 disconnectUpdateSignal();
568 mScalebar->setLabelBarSpace( d );
570 connectUpdateSignal();
571 mScalebar->endCommand();
574 void QgsLayoutScaleBarWidget::mBoxSizeSpinBox_valueChanged(
double d )
582 disconnectUpdateSignal();
583 mScalebar->setBoxContentSpace( d );
585 connectUpdateSignal();
586 mScalebar->endCommand();
589 void QgsLayoutScaleBarWidget::mLabelVerticalPlacementComboBox_currentIndexChanged(
int index )
596 mScalebar->beginCommand( tr(
"Set Scalebar Label Vertical Placement" ) );
597 disconnectUpdateSignal();
600 connectUpdateSignal();
601 mScalebar->endCommand();
604 void QgsLayoutScaleBarWidget::mLabelHorizontalPlacementComboBox_currentIndexChanged(
int index )
611 mScalebar->beginCommand( tr(
"Set Scalebar Label Horizontal Placement" ) );
612 disconnectUpdateSignal();
615 connectUpdateSignal();
616 mScalebar->endCommand();
619 void QgsLayoutScaleBarWidget::alignmentChanged()
626 mScalebar->beginCommand( tr(
"Set Scalebar Alignment" ) );
627 disconnectUpdateSignal();
631 mScalebar->setAlignment( a );
633 connectUpdateSignal();
634 mScalebar->endCommand();
637 void QgsLayoutScaleBarWidget::mUnitsComboBox_currentIndexChanged(
int index )
644 const QVariant unitData = mUnitsComboBox->itemData( index );
645 if ( unitData.type() == QVariant::Invalid )
650 disconnectUpdateSignal();
651 mScalebar->beginCommand( tr(
"Set Scalebar Units" ) );
655 mNumberOfSegmentsSpinBox->setValue( mScalebar->numberOfSegments() );
656 mSegmentsLeftSpinBox->setValue( mScalebar->numberOfSegmentsLeft() );
657 mUnitLabelLineEdit->setText( mScalebar->unitLabel() );
658 mSegmentSizeSpinBox->setValue( mScalebar->unitsPerSegment() );
659 mMapUnitsPerBarUnitSpinBox->setValue( mScalebar->mapUnitsPerScaleBarUnit() );
661 connectUpdateSignal();
662 mScalebar->endCommand();
665 void QgsLayoutScaleBarWidget::blockMemberSignals(
bool block )
667 mSegmentSizeSpinBox->blockSignals( block );
668 mNumberOfSegmentsSpinBox->blockSignals( block );
669 mSegmentsLeftSpinBox->blockSignals( block );
670 mNumberOfSubdivisionsSpinBox->blockSignals( block );
671 mSubdivisionsHeightSpinBox->blockSignals( block );
672 mStyleComboBox->blockSignals( block );
673 mUnitLabelLineEdit->blockSignals( block );
674 mMapUnitsPerBarUnitSpinBox->blockSignals( block );
675 mHeightSpinBox->blockSignals( block );
676 mLineStyleButton->blockSignals( block );
677 mDivisionStyleButton->blockSignals( block );
678 mSubdivisionStyleButton->blockSignals( block );
679 mLabelBarSpaceSpinBox->blockSignals( block );
680 mBoxSizeSpinBox->blockSignals( block );
681 mLabelVerticalPlacementComboBox->blockSignals( block );
682 mLabelHorizontalPlacementComboBox->blockSignals( block );
683 mAlignmentComboBox->blockSignals( block );
684 mUnitsComboBox->blockSignals( block );
685 mFillSymbol1Button->blockSignals( block );
686 mFillSymbol2Button->blockSignals( block );
687 mSegmentSizeRadioGroup.blockSignals( block );
688 mMapItemComboBox->blockSignals( block );
689 mFontButton->blockSignals( block );
690 mMinWidthSpinBox->blockSignals( block );
691 mMaxWidthSpinBox->blockSignals( block );
694 void QgsLayoutScaleBarWidget::connectUpdateSignal()
702 void QgsLayoutScaleBarWidget::disconnectUpdateSignal()
710 void QgsLayoutScaleBarWidget::segmentSizeRadioChanged( QAbstractButton *radio )
712 const bool fixedSizeMode = radio == mFixedSizeRadio;
713 mMinWidthSpinBox->setEnabled( !fixedSizeMode );
714 mMaxWidthSpinBox->setEnabled( !fixedSizeMode );
715 mSegmentSizeSpinBox->setEnabled( fixedSizeMode );
723 disconnectUpdateSignal();
724 if ( mFixedSizeRadio->isChecked() )
727 mScalebar->setUnitsPerSegment( mSegmentSizeSpinBox->value() );
734 connectUpdateSignal();
735 mScalebar->endCommand();
738 void QgsLayoutScaleBarWidget::mapChanged(
QgsLayoutItem *item )
747 mScalebar->beginCommand( tr(
"Set Scalebar Map" ) );
748 disconnectUpdateSignal();
749 mScalebar->setLinkedMap( map );
751 connectUpdateSignal();
752 mScalebar->endCommand();
755 void QgsLayoutScaleBarWidget::mMinWidthSpinBox_valueChanged(
double )
763 disconnectUpdateSignal();
764 mScalebar->setMinimumBarWidth( mMinWidthSpinBox->value() );
766 connectUpdateSignal();
767 mScalebar->endCommand();
770 void QgsLayoutScaleBarWidget::mMaxWidthSpinBox_valueChanged(
double )
778 disconnectUpdateSignal();
779 mScalebar->setMaximumBarWidth( mMaxWidthSpinBox->value() );
781 connectUpdateSignal();
782 mScalebar->endCommand();
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.
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...
@ 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() )
Alignment
Scalebar alignment.
@ AlignMiddle
Center aligned.
@ AlignRight
Right aligned.
LabelHorizontalPlacement
Label horizontal placement.
@ LabelCenteredSegment
Labels are drawn centered relative to segment.
@ LabelCenteredEdge
Labels are drawn centered relative to segment's edge.
LabelVerticalPlacement
Label vertical placement.
@ LabelAboveSegment
Labels are drawn above the scalebar.
@ LabelBelowSegment
Labels are drawn below the scalebar.
@ SegmentSizeFitWidth
Scale bar segment size is calculated to fit a size range.
@ SegmentSizeFixed
Scale bar segment size is fixed to a map unit.
DistanceUnit
Units of distance.
@ DistanceKilometers
Kilometers.
@ DistanceMiles
Terrestrial miles.
@ DistanceUnknownUnit
Unknown distance unit.
@ DistanceMillimeters
Millimeters.
@ DistanceYards
Imperial yards.
@ DistanceFeet
Imperial feet.
@ DistanceNauticalMiles
Nautical miles.
@ DistanceCentimeters
Centimeters.
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.