25 #include <QColorDialog> 26 #include <QFontDialog> 31 , mScalebar( scaleBar )
34 connect( mHeightSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutScaleBarWidget::mHeightSpinBox_valueChanged );
35 connect( mLineWidthSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutScaleBarWidget::mLineWidthSpinBox_valueChanged );
36 connect( mSegmentSizeSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutScaleBarWidget::mSegmentSizeSpinBox_valueChanged );
37 connect( mSegmentsLeftSpinBox, static_cast <
void ( QSpinBox::* )(
int ) > ( &QSpinBox::valueChanged ),
this, &QgsLayoutScaleBarWidget::mSegmentsLeftSpinBox_valueChanged );
38 connect( mNumberOfSegmentsSpinBox, static_cast <
void ( QSpinBox::* )(
int ) > ( &QSpinBox::valueChanged ),
this, &QgsLayoutScaleBarWidget::mNumberOfSegmentsSpinBox_valueChanged );
39 connect( mUnitLabelLineEdit, &QLineEdit::textChanged,
this, &QgsLayoutScaleBarWidget::mUnitLabelLineEdit_textChanged );
40 connect( mMapUnitsPerBarUnitSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutScaleBarWidget::mMapUnitsPerBarUnitSpinBox_valueChanged );
44 connect( mStyleComboBox, &QComboBox::currentTextChanged,
this, &QgsLayoutScaleBarWidget::mStyleComboBox_currentIndexChanged );
45 connect( mLabelBarSpaceSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutScaleBarWidget::mLabelBarSpaceSpinBox_valueChanged );
46 connect( mBoxSizeSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutScaleBarWidget::mBoxSizeSpinBox_valueChanged );
48 connect( mLabelVerticalPlacementComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutScaleBarWidget::mLabelVerticalPlacementComboBox_currentIndexChanged );
49 connect( mLabelHorizontalPlacementComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutScaleBarWidget::mLabelHorizontalPlacementComboBox_currentIndexChanged );
50 connect( mUnitsComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutScaleBarWidget::mUnitsComboBox_currentIndexChanged );
51 connect( mLineJoinStyleCombo,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutScaleBarWidget::mLineJoinStyleCombo_currentIndexChanged );
52 connect( mLineCapStyleCombo,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutScaleBarWidget::mLineCapStyleCombo_currentIndexChanged );
53 connect( mMinWidthSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutScaleBarWidget::mMinWidthSpinBox_valueChanged );
54 connect( mMaxWidthSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutScaleBarWidget::mMaxWidthSpinBox_valueChanged );
55 connect( mNumberFormatPushButton, &QPushButton::clicked,
this, &QgsLayoutScaleBarWidget::changeNumberFormat );
58 mFontButton->registerExpressionContextGenerator(
this );
60 connectUpdateSignal();
64 mainLayout->addWidget( mItemPropertiesWidget );
66 mSegmentSizeRadioGroup.addButton( mFixedSizeRadio );
67 mSegmentSizeRadioGroup.addButton( mFitWidthRadio );
68 connect( &mSegmentSizeRadioGroup, static_cast <
void ( QButtonGroup::* )( QAbstractButton * ) > ( &QButtonGroup::buttonClicked ),
this, &QgsLayoutScaleBarWidget::segmentSizeRadioChanged );
70 blockMemberSignals(
true );
73 mStyleComboBox->insertItem( 0, tr(
"Single Box" ) );
74 mStyleComboBox->insertItem( 1, tr(
"Double Box" ) );
75 mStyleComboBox->insertItem( 2, tr(
"Line Ticks Middle" ) );
76 mStyleComboBox->insertItem( 3, tr(
"Line Ticks Down" ) );
77 mStyleComboBox->insertItem( 4, tr(
"Line Ticks Up" ) );
78 mStyleComboBox->insertItem( 5, tr(
"Numeric" ) );
87 mAlignmentComboBox->setAvailableAlignments( Qt::AlignLeft | Qt::AlignHCenter | Qt::AlignRight );
100 mFillColorButton->setColorDialogTitle( tr(
"Select Fill Color" ) );
101 mFillColorButton->setAllowOpacity(
true );
102 mFillColorButton->setContext( QStringLiteral(
"composer" ) );
103 mFillColorButton->setNoColorString( tr(
"Transparent Fill" ) );
104 mFillColorButton->setShowNoColor(
true );
106 mFillColor2Button->setColorDialogTitle( tr(
"Select Alternate Fill Color" ) );
107 mFillColor2Button->setAllowOpacity(
true );
108 mFillColor2Button->setContext( QStringLiteral(
"composer" ) );
109 mFillColor2Button->setNoColorString( tr(
"Transparent Fill" ) );
110 mFillColor2Button->setShowNoColor(
true );
112 mFontButton->setDialogTitle( tr(
"Scalebar Font" ) );
115 mStrokeColorButton->setColorDialogTitle( tr(
"Select Line Color" ) );
116 mStrokeColorButton->setAllowOpacity(
true );
117 mStrokeColorButton->setContext( QStringLiteral(
"composer" ) );
118 mStrokeColorButton->setNoColorString( tr(
"Transparent Line" ) );
119 mStrokeColorButton->setShowNoColor(
true );
121 mFillColorDDBtn->registerLinkedWidget( mFillColorButton );
122 mFillColor2DDBtn->registerLinkedWidget( mFillColor2Button );
123 mLineColorDDBtn->registerLinkedWidget( mStrokeColorButton );
127 mFillColorDDBtn->registerExpressionContextGenerator( mScalebar );
128 mFillColor2DDBtn->registerExpressionContextGenerator( mScalebar );
129 mLineColorDDBtn->registerExpressionContextGenerator( mScalebar );
130 mLineWidthDDBtn->registerExpressionContextGenerator( mScalebar );
131 QgsLayout *scaleBarLayout = mScalebar->layout();
132 if ( scaleBarLayout )
134 mMapItemComboBox->setCurrentLayout( scaleBarLayout );
146 blockMemberSignals(
false );
151 if ( mScalebar->layout() )
159 if ( mItemPropertiesWidget )
178 disconnectUpdateSignal();
181 mItemPropertiesWidget->
setItem( mScalebar );
185 connectUpdateSignal();
186 mFillColorDDBtn->registerExpressionContextGenerator( mScalebar );
187 mFillColor2DDBtn->registerExpressionContextGenerator( mScalebar );
188 mLineColorDDBtn->registerExpressionContextGenerator( mScalebar );
189 mLineWidthDDBtn->registerExpressionContextGenerator( mScalebar );
197 void QgsLayoutScaleBarWidget::setGuiElements()
204 blockMemberSignals(
true );
205 mNumberOfSegmentsSpinBox->setValue( mScalebar->numberOfSegments() );
206 mSegmentsLeftSpinBox->setValue( mScalebar->numberOfSegmentsLeft() );
207 mSegmentSizeSpinBox->setValue( mScalebar->unitsPerSegment() );
208 mLineWidthSpinBox->setValue( mScalebar->lineWidth() );
209 mHeightSpinBox->setValue( mScalebar->height() );
210 mMapUnitsPerBarUnitSpinBox->setValue( mScalebar->mapUnitsPerScaleBarUnit() );
211 mLabelBarSpaceSpinBox->setValue( mScalebar->labelBarSpace() );
212 mBoxSizeSpinBox->setValue( mScalebar->boxContentSpace() );
213 mUnitLabelLineEdit->setText( mScalebar->unitLabel() );
214 mLineJoinStyleCombo->setPenJoinStyle( mScalebar->lineJoinStyle() );
215 mLineCapStyleCombo->setPenCapStyle( mScalebar->lineCapStyle() );
216 mFillColorButton->setColor( mScalebar->fillColor() );
217 mFillColor2Button->setColor( mScalebar->fillColor2() );
218 mStrokeColorButton->setColor( mScalebar->lineColor() );
219 mFontButton->setTextFormat( mScalebar->textFormat() );
222 mMapItemComboBox->setItem( mScalebar->linkedMap() );
225 QString style = mScalebar->style();
226 mStyleComboBox->setCurrentIndex( mStyleComboBox->findText( tr( style.toLocal8Bit().data() ) ) );
227 toggleStyleSpecificControls( style );
230 mLabelVerticalPlacementComboBox->setCurrentIndex( mLabelVerticalPlacementComboBox->findData( static_cast< int >( mScalebar->labelVerticalPlacement() ) ) );
231 mLabelHorizontalPlacementComboBox->setCurrentIndex( mLabelHorizontalPlacementComboBox->findData( static_cast< int >( mScalebar->labelHorizontalPlacement() ) ) );
235 Qt::Alignment a = Qt::AlignLeft;
236 switch ( mScalebar->alignment() )
245 a = Qt::AlignHCenter;
248 mAlignmentComboBox->setCurrentAlignment( a );
251 mUnitsComboBox->setCurrentIndex( mUnitsComboBox->findData( static_cast< int >( mScalebar->units() ) ) );
255 mFixedSizeRadio->setChecked(
true );
256 mSegmentSizeSpinBox->setEnabled(
true );
257 mMinWidthSpinBox->setEnabled(
false );
258 mMaxWidthSpinBox->setEnabled(
false );
262 mFitWidthRadio->setChecked(
true );
263 mSegmentSizeSpinBox->setEnabled(
false );
264 mMinWidthSpinBox->setEnabled(
true );
265 mMaxWidthSpinBox->setEnabled(
true );
267 mMinWidthSpinBox->setValue( mScalebar->minimumBarWidth() );
268 mMaxWidthSpinBox->setValue( mScalebar->maximumBarWidth() );
273 blockMemberSignals(
false );
278 void QgsLayoutScaleBarWidget::mLineWidthSpinBox_valueChanged(
double d )
286 disconnectUpdateSignal();
287 mScalebar->setLineWidth( d );
289 connectUpdateSignal();
290 mScalebar->endCommand();
293 void QgsLayoutScaleBarWidget::mSegmentSizeSpinBox_valueChanged(
double d )
301 disconnectUpdateSignal();
302 mScalebar->setUnitsPerSegment( d );
304 connectUpdateSignal();
305 mScalebar->endCommand();
308 void QgsLayoutScaleBarWidget::mSegmentsLeftSpinBox_valueChanged(
int i )
316 disconnectUpdateSignal();
317 mScalebar->setNumberOfSegmentsLeft( i );
319 connectUpdateSignal();
320 mScalebar->endCommand();
323 void QgsLayoutScaleBarWidget::mNumberOfSegmentsSpinBox_valueChanged(
int i )
331 disconnectUpdateSignal();
332 mScalebar->setNumberOfSegments( i );
334 connectUpdateSignal();
335 mScalebar->endCommand();
338 void QgsLayoutScaleBarWidget::mHeightSpinBox_valueChanged(
double d )
345 disconnectUpdateSignal();
346 mScalebar->setHeight( d );
348 connectUpdateSignal();
349 mScalebar->endCommand();
352 void QgsLayoutScaleBarWidget::textFormatChanged()
359 mScalebar->beginCommand( tr(
"Set Scalebar Font" ) );
360 disconnectUpdateSignal();
361 mScalebar->setTextFormat( mFontButton->textFormat() );
362 connectUpdateSignal();
363 mScalebar->endCommand();
367 void QgsLayoutScaleBarWidget::changeNumberFormat()
376 widget->
setFormat( mScalebar->numericFormat() );
379 mScalebar->beginCommand( tr(
"Set Scalebar Number Format" ) );
380 disconnectUpdateSignal();
381 mScalebar->setNumericFormat( widget->
format() );
382 connectUpdateSignal();
383 mScalebar->endCommand();
390 void QgsLayoutScaleBarWidget::mFillColorButton_colorChanged(
const QColor &newColor )
398 disconnectUpdateSignal();
399 mScalebar->setFillColor( newColor );
401 connectUpdateSignal();
402 mScalebar->endCommand();
405 void QgsLayoutScaleBarWidget::mFillColor2Button_colorChanged(
const QColor &newColor )
413 disconnectUpdateSignal();
414 mScalebar->setFillColor2( newColor );
416 connectUpdateSignal();
417 mScalebar->endCommand();
420 void QgsLayoutScaleBarWidget::mStrokeColorButton_colorChanged(
const QColor &newColor )
428 disconnectUpdateSignal();
429 mScalebar->setLineColor( newColor );
431 connectUpdateSignal();
432 mScalebar->endCommand();
435 void QgsLayoutScaleBarWidget::mUnitLabelLineEdit_textChanged(
const QString &text )
443 disconnectUpdateSignal();
444 mScalebar->setUnitLabel( text );
446 connectUpdateSignal();
447 mScalebar->endCommand();
450 void QgsLayoutScaleBarWidget::mMapUnitsPerBarUnitSpinBox_valueChanged(
double d )
458 disconnectUpdateSignal();
459 mScalebar->setMapUnitsPerScaleBarUnit( d );
461 connectUpdateSignal();
462 mScalebar->endCommand();
465 void QgsLayoutScaleBarWidget::mStyleComboBox_currentIndexChanged(
const QString &text )
472 mScalebar->beginCommand( tr(
"Set Scalebar Style" ) );
473 disconnectUpdateSignal();
474 QString untranslatedStyleName;
475 if ( text == tr(
"Single Box" ) )
477 untranslatedStyleName = QStringLiteral(
"Single Box" );
479 else if ( text == tr(
"Double Box" ) )
481 untranslatedStyleName = QStringLiteral(
"Double Box" );
483 else if ( text == tr(
"Line Ticks Middle" ) )
485 untranslatedStyleName = QStringLiteral(
"Line Ticks Middle" );
487 else if ( text == tr(
"Line Ticks Middle" ) )
489 untranslatedStyleName = QStringLiteral(
"Line Ticks Middle" );
491 else if ( text == tr(
"Line Ticks Down" ) )
493 untranslatedStyleName = QStringLiteral(
"Line Ticks Down" );
495 else if ( text == tr(
"Line Ticks Up" ) )
497 untranslatedStyleName = QStringLiteral(
"Line Ticks Up" );
499 else if ( text == tr(
"Numeric" ) )
501 untranslatedStyleName = QStringLiteral(
"Numeric" );
505 toggleStyleSpecificControls( untranslatedStyleName );
507 mScalebar->setStyle( untranslatedStyleName );
509 connectUpdateSignal();
510 mScalebar->endCommand();
513 void QgsLayoutScaleBarWidget::toggleStyleSpecificControls(
const QString &style )
515 if ( style == QLatin1String(
"Numeric" ) )
518 mUnitsComboBox->setEnabled(
false );
519 mUnitsLabel->setEnabled(
false );
520 mMapUnitsPerBarUnitSpinBox->setEnabled(
false );
521 mMapUnitsPerBarUnitLabel->setEnabled(
false );
522 mUnitLabelLineEdit->setEnabled(
false );
523 mUnitLabelLabel->setEnabled(
false );
524 mGroupBoxSegments->setEnabled(
false );
525 mGroupBoxSegments->setCollapsed(
true );
526 mLabelBarSpaceSpinBox->setEnabled(
false );
527 mLineWidthSpinBox->setEnabled(
false );
528 mFillColorButton->setEnabled(
false );
529 mFillColor2Button->setEnabled(
false );
530 mStrokeColorButton->setEnabled(
false );
531 mLineJoinStyleCombo->setEnabled(
false );
532 mLineCapStyleCombo->setEnabled(
false );
533 mLabelVerticalPlacementComboBox->setEnabled(
false );
534 mLabelHorizontalPlacementComboBox->setEnabled(
false );
535 mAlignmentComboBox->setEnabled(
true );
540 mUnitsComboBox->setEnabled(
true );
541 mUnitsLabel->setEnabled(
true );
542 mMapUnitsPerBarUnitSpinBox->setEnabled(
true );
543 mMapUnitsPerBarUnitLabel->setEnabled(
true );
544 mUnitLabelLineEdit->setEnabled(
true );
545 mUnitLabelLabel->setEnabled(
true );
546 mGroupBoxSegments->setEnabled(
true );
547 mLabelBarSpaceSpinBox->setEnabled(
true );
548 mLineWidthSpinBox->setEnabled(
true );
549 mFillColorButton->setEnabled(
true );
550 mFillColor2Button->setEnabled(
true );
551 mStrokeColorButton->setEnabled(
true );
552 mLabelVerticalPlacementComboBox->setEnabled(
true );
553 mLabelHorizontalPlacementComboBox->setEnabled(
true );
554 mAlignmentComboBox->setEnabled(
false );
555 if ( style == QLatin1String(
"Single Box" ) || style == QLatin1String(
"Double Box" ) )
557 mLineJoinStyleCombo->setEnabled(
true );
558 mLineCapStyleCombo->setEnabled(
false );
562 mLineJoinStyleCombo->setEnabled(
false );
563 mLineCapStyleCombo->setEnabled(
true );
569 void QgsLayoutScaleBarWidget::mLabelBarSpaceSpinBox_valueChanged(
double d )
577 disconnectUpdateSignal();
578 mScalebar->setLabelBarSpace( d );
580 connectUpdateSignal();
581 mScalebar->endCommand();
584 void QgsLayoutScaleBarWidget::mBoxSizeSpinBox_valueChanged(
double d )
592 disconnectUpdateSignal();
593 mScalebar->setBoxContentSpace( d );
595 connectUpdateSignal();
596 mScalebar->endCommand();
599 void QgsLayoutScaleBarWidget::mLabelVerticalPlacementComboBox_currentIndexChanged(
int index )
606 mScalebar->beginCommand( tr(
"Set Scalebar Label Vertical Placement" ) );
607 disconnectUpdateSignal();
608 mScalebar->setLabelVerticalPlacement( static_cast<QgsScaleBarSettings::LabelVerticalPlacement>( mLabelVerticalPlacementComboBox->itemData( index ).toInt() ) );
610 connectUpdateSignal();
611 mScalebar->endCommand();
614 void QgsLayoutScaleBarWidget::mLabelHorizontalPlacementComboBox_currentIndexChanged(
int index )
621 mScalebar->beginCommand( tr(
"Set Scalebar Label Horizontal Placement" ) );
622 disconnectUpdateSignal();
623 mScalebar->setLabelHorizontalPlacement( static_cast<QgsScaleBarSettings::LabelHorizontalPlacement>( mLabelHorizontalPlacementComboBox->itemData( index ).toInt() ) );
625 connectUpdateSignal();
626 mScalebar->endCommand();
629 void QgsLayoutScaleBarWidget::alignmentChanged()
636 mScalebar->beginCommand( tr(
"Set Scalebar Alignment" ) );
637 disconnectUpdateSignal();
641 mScalebar->setAlignment( a );
643 connectUpdateSignal();
644 mScalebar->endCommand();
647 void QgsLayoutScaleBarWidget::mUnitsComboBox_currentIndexChanged(
int index )
654 QVariant unitData = mUnitsComboBox->itemData( index );
655 if ( unitData.type() == QVariant::Invalid )
660 disconnectUpdateSignal();
661 mScalebar->beginCommand( tr(
"Set Scalebar Units" ) );
662 mScalebar->applyDefaultSize( static_cast< QgsUnitTypes::DistanceUnit >( unitData.toInt() ) );
665 mUnitLabelLineEdit->setText( mScalebar->unitLabel() );
666 mSegmentSizeSpinBox->setValue( mScalebar->unitsPerSegment() );
667 mMapUnitsPerBarUnitSpinBox->setValue( mScalebar->mapUnitsPerScaleBarUnit() );
669 connectUpdateSignal();
670 mScalebar->endCommand();
673 void QgsLayoutScaleBarWidget::blockMemberSignals(
bool block )
675 mSegmentSizeSpinBox->blockSignals( block );
676 mNumberOfSegmentsSpinBox->blockSignals( block );
677 mSegmentsLeftSpinBox->blockSignals( block );
678 mStyleComboBox->blockSignals( block );
679 mUnitLabelLineEdit->blockSignals( block );
680 mMapUnitsPerBarUnitSpinBox->blockSignals( block );
681 mHeightSpinBox->blockSignals( block );
682 mLineWidthSpinBox->blockSignals( block );
683 mLabelBarSpaceSpinBox->blockSignals( block );
684 mBoxSizeSpinBox->blockSignals( block );
685 mLabelVerticalPlacementComboBox->blockSignals( block );
686 mLabelHorizontalPlacementComboBox->blockSignals( block );
687 mAlignmentComboBox->blockSignals( block );
688 mUnitsComboBox->blockSignals( block );
689 mLineJoinStyleCombo->blockSignals( block );
690 mLineCapStyleCombo->blockSignals( block );
691 mFillColorButton->blockSignals( block );
692 mFillColor2Button->blockSignals( block );
693 mStrokeColorButton->blockSignals( block );
694 mSegmentSizeRadioGroup.blockSignals( block );
695 mMapItemComboBox->blockSignals( block );
696 mFontButton->blockSignals( block );
697 mMinWidthSpinBox->blockSignals( block );
698 mMaxWidthSpinBox->blockSignals( block );
701 void QgsLayoutScaleBarWidget::connectUpdateSignal()
709 void QgsLayoutScaleBarWidget::disconnectUpdateSignal()
717 void QgsLayoutScaleBarWidget::mLineJoinStyleCombo_currentIndexChanged(
int index )
725 mScalebar->beginCommand( tr(
"Set Scalebar Join Style" ) );
726 mScalebar->setLineJoinStyle( mLineJoinStyleCombo->penJoinStyle() );
727 mScalebar->endCommand();
730 void QgsLayoutScaleBarWidget::mLineCapStyleCombo_currentIndexChanged(
int index )
738 mScalebar->beginCommand( tr(
"Set Scalebar Cap Style" ) );
739 mScalebar->setLineCapStyle( mLineCapStyleCombo->penCapStyle() );
740 mScalebar->endCommand();
743 void QgsLayoutScaleBarWidget::segmentSizeRadioChanged( QAbstractButton *radio )
745 bool fixedSizeMode = radio == mFixedSizeRadio;
746 mMinWidthSpinBox->setEnabled( !fixedSizeMode );
747 mMaxWidthSpinBox->setEnabled( !fixedSizeMode );
748 mSegmentSizeSpinBox->setEnabled( fixedSizeMode );
756 disconnectUpdateSignal();
757 if ( mFixedSizeRadio->isChecked() )
760 mScalebar->setUnitsPerSegment( mSegmentSizeSpinBox->value() );
767 connectUpdateSignal();
768 mScalebar->endCommand();
771 void QgsLayoutScaleBarWidget::mapChanged(
QgsLayoutItem *item )
780 mScalebar->beginCommand( tr(
"Set Scalebar Map" ) );
781 disconnectUpdateSignal();
782 mScalebar->setLinkedMap( map );
784 connectUpdateSignal();
785 mScalebar->endCommand();
788 void QgsLayoutScaleBarWidget::mMinWidthSpinBox_valueChanged(
double )
796 disconnectUpdateSignal();
797 mScalebar->setMinimumBarWidth( mMinWidthSpinBox->value() );
799 connectUpdateSignal();
800 mScalebar->endCommand();
803 void QgsLayoutScaleBarWidget::mMaxWidthSpinBox_valueChanged(
double )
811 disconnectUpdateSignal();
812 mScalebar->setMaximumBarWidth( mMaxWidthSpinBox->value() );
814 connectUpdateSignal();
815 mScalebar->endCommand();
Single variable definition for use within a QgsExpressionContextScope.
Scale bar segment size is calculated to fit a size range.
Base class for graphical items within a QgsLayout.
int type() const override
Returns a unique graphics item type identifier.
Scalebar secondary fill color.
Alignment
Scalebar alignment.
void addVariable(const QgsExpressionContextScope::StaticVariable &variable)
Adds a variable into the context scope.
Layout graphical items for displaying a map.
Scalebar secondary fill color.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Scalebar map units per segment.
void layerChanged(QgsVectorLayer *layer)
Emitted when the context's layer is changed.
Single scope for storing variables and functions for use within a QgsExpressionContext.
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
Scale bar segment size is fixed to a map unit.
void itemChanged(QgsLayoutItem *item)
Emitted whenever the currently selected item changes.
Labels are drawn above the scalebar.
Labels are drawn centered relative to segment's edge.
Scalebar box context space.
void appendScope(QgsExpressionContextScope *scope)
Appends a scope to the end of the context.
Labels are drawn centered relative to segment.
void changed()
Emitted when the alignment is changed.
A layout item subclass for scale bars.
void setHighlightedVariables(const QStringList &variableNames)
Sets the list of variable names within the context intended to be highlighted to the user...
Interface for master layout type objects, such as print layouts and reports.
Scalebar number of segments.
void changed()
Emitted when the object's properties change.
Labels are drawn below the scalebar.