Skip to content
Permalink
Browse files

Autoraise map unit scale tool buttons

  • Loading branch information
nyalldawson committed Aug 31, 2018
1 parent 91cebc4 commit 4e3d61c3e9fa2fd75109851267ef6be36cebee21
Showing with 7 additions and 4 deletions.
  1. +3 −3 src/gui/qgsunitselectionwidget.cpp
  2. +4 −1 src/ui/qgsunitselectionwidget.ui
@@ -136,7 +136,7 @@ QgsUnitSelectionWidget::QgsUnitSelectionWidget( QWidget *parent )
setFocusProxy( mUnitCombo );

connect( mUnitCombo, static_cast < void ( QComboBox::* )( int ) > ( &QComboBox::currentIndexChanged ), this, &QgsUnitSelectionWidget::toggleUnitRangeButton );
connect( mMapScaleButton, &QPushButton::clicked, this, &QgsUnitSelectionWidget::showDialog );
connect( mMapScaleButton, &QToolButton::clicked, this, &QgsUnitSelectionWidget::showDialog );
connect( mUnitCombo, static_cast < void ( QComboBox::* )( int ) > ( &QComboBox::currentIndexChanged ), this, &QgsUnitSelectionWidget::changed );
}

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

void QgsUnitSelectionWidget::setUnit( QgsUnitTypes::RenderUnit unit )
{
int idx = mUnitCombo->findData( QVariant( ( int ) unit ) );
int idx = mUnitCombo->findData( QVariant( static_cast< int >( unit ) ) );
mUnitCombo->setCurrentIndex( idx == -1 ? 0 : idx );
}

@@ -46,7 +46,7 @@
</widget>
</item>
<item>
<widget class="QPushButton" name="mMapScaleButton">
<widget class="QToolButton" name="mMapScaleButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
@@ -63,6 +63,9 @@
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/mActionOptions.svg</normaloff>:/images/themes/default/mActionOptions.svg</iconset>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
</layout>

0 comments on commit 4e3d61c

Please sign in to comment.
You can’t perform that action at this time.