Skip to content

Commit 4e3d61c

Browse files
committed
Autoraise map unit scale tool buttons
1 parent 91cebc4 commit 4e3d61c

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/gui/qgsunitselectionwidget.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ QgsUnitSelectionWidget::QgsUnitSelectionWidget( QWidget *parent )
136136
setFocusProxy( mUnitCombo );
137137

138138
connect( mUnitCombo, static_cast < void ( QComboBox::* )( int ) > ( &QComboBox::currentIndexChanged ), this, &QgsUnitSelectionWidget::toggleUnitRangeButton );
139-
connect( mMapScaleButton, &QPushButton::clicked, this, &QgsUnitSelectionWidget::showDialog );
139+
connect( mMapScaleButton, &QToolButton::clicked, this, &QgsUnitSelectionWidget::showDialog );
140140
connect( mUnitCombo, static_cast < void ( QComboBox::* )( int ) > ( &QComboBox::currentIndexChanged ), this, &QgsUnitSelectionWidget::changed );
141141
}
142142

@@ -196,7 +196,7 @@ QgsUnitTypes::RenderUnit QgsUnitSelectionWidget::unit() const
196196
QVariant currentData = mUnitCombo->currentData();
197197
if ( currentData.isValid() )
198198
{
199-
return ( QgsUnitTypes::RenderUnit ) currentData.toInt();
199+
return static_cast< QgsUnitTypes::RenderUnit >( currentData.toInt() );
200200
}
201201
//unknown
202202
return QgsUnitTypes::RenderUnknownUnit;
@@ -211,7 +211,7 @@ void QgsUnitSelectionWidget::setUnit( int unitIndex )
211211

212212
void QgsUnitSelectionWidget::setUnit( QgsUnitTypes::RenderUnit unit )
213213
{
214-
int idx = mUnitCombo->findData( QVariant( ( int ) unit ) );
214+
int idx = mUnitCombo->findData( QVariant( static_cast< int >( unit ) ) );
215215
mUnitCombo->setCurrentIndex( idx == -1 ? 0 : idx );
216216
}
217217

src/ui/qgsunitselectionwidget.ui

+4-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
</widget>
4747
</item>
4848
<item>
49-
<widget class="QPushButton" name="mMapScaleButton">
49+
<widget class="QToolButton" name="mMapScaleButton">
5050
<property name="sizePolicy">
5151
<sizepolicy hsizetype="Maximum" vsizetype="MinimumExpanding">
5252
<horstretch>0</horstretch>
@@ -63,6 +63,9 @@
6363
<iconset resource="../../images/images.qrc">
6464
<normaloff>:/images/themes/default/mActionOptions.svg</normaloff>:/images/themes/default/mActionOptions.svg</iconset>
6565
</property>
66+
<property name="autoRaise">
67+
<bool>true</bool>
68+
</property>
6669
</widget>
6770
</item>
6871
</layout>

0 commit comments

Comments
 (0)