Skip to content

Commit

Permalink
Minimum subdivision count is 1, not 0
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed May 7, 2020
1 parent 6e9b7ae commit 8b7f403
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/gui/layout/qgslayoutscalebarwidget.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ QgsLayoutScaleBarWidget::QgsLayoutScaleBarWidget( QgsLayoutItemScaleBar *scaleBa
, mScalebar( scaleBar ) , mScalebar( scaleBar )
{ {
setupUi( this ); setupUi( this );

mNumberOfSubdivisionsSpinBox->setClearValue( 1 );

connect( mHeightSpinBox, static_cast < void ( QDoubleSpinBox::* )( double ) > ( &QDoubleSpinBox::valueChanged ), this, &QgsLayoutScaleBarWidget::mHeightSpinBox_valueChanged ); connect( mHeightSpinBox, static_cast < void ( QDoubleSpinBox::* )( double ) > ( &QDoubleSpinBox::valueChanged ), this, &QgsLayoutScaleBarWidget::mHeightSpinBox_valueChanged );
connect( mSegmentSizeSpinBox, static_cast < void ( QDoubleSpinBox::* )( double ) > ( &QDoubleSpinBox::valueChanged ), this, &QgsLayoutScaleBarWidget::mSegmentSizeSpinBox_valueChanged ); connect( mSegmentSizeSpinBox, static_cast < void ( QDoubleSpinBox::* )( double ) > ( &QDoubleSpinBox::valueChanged ), this, &QgsLayoutScaleBarWidget::mSegmentSizeSpinBox_valueChanged );
connect( mSegmentsLeftSpinBox, static_cast < void ( QSpinBox::* )( int ) > ( &QSpinBox::valueChanged ), this, &QgsLayoutScaleBarWidget::mSegmentsLeftSpinBox_valueChanged ); connect( mSegmentsLeftSpinBox, static_cast < void ( QSpinBox::* )( int ) > ( &QSpinBox::valueChanged ), this, &QgsLayoutScaleBarWidget::mSegmentsLeftSpinBox_valueChanged );
Expand Down
9 changes: 6 additions & 3 deletions src/ui/layout/qgslayoutscalebarwidgetbase.ui
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>-307</y> <y>0</y>
<width>440</width> <width>451</width>
<height>944</height> <height>1012</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="mainLayout"> <layout class="QVBoxLayout" name="mainLayout">
Expand Down Expand Up @@ -359,6 +359,9 @@
<property name="prefix"> <property name="prefix">
<string/> <string/>
</property> </property>
<property name="minimum">
<number>1</number>
</property>
</widget> </widget>
</item> </item>
<item row="7" column="0"> <item row="7" column="0">
Expand Down

0 comments on commit 8b7f403

Please sign in to comment.