Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Dynamically change label to lat/long when in geographic CRS
  • Loading branch information
nyalldawson committed Sep 23, 2021
1 parent 139cc2d commit 72367db
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions src/gui/qgsadvanceddigitizingdockwidget.cpp
Expand Up @@ -1410,6 +1410,9 @@ void QgsAdvancedDigitizingDockWidget::enable()
mDistanceLineEdit->setEnabled( false );
mDistanceLineEdit->setToolTip( tr( "Distance constraint cannot be used on geographic coordinates. Change the coordinates system in the project properties." ) );

mLabelX->setText( tr( "Long" ) );
mLabelY->setText( tr( "Lat" ) );

mXConstraint->setPrecision( 8 );
mYConstraint->setPrecision( 8 );
}
Expand All @@ -1421,6 +1424,9 @@ void QgsAdvancedDigitizingDockWidget::enable()
mDistanceLineEdit->setEnabled( true );
mDistanceLineEdit->setToolTip( "<b>" + tr( "Distance" ) + "</b><br>(" + tr( "press d for quick access" ) + ")" );

mLabelX->setText( tr( "x" ) );
mLabelY->setText( tr( "y" ) );

mXConstraint->setPrecision( 6 );
mYConstraint->setPrecision( 6 );
}
Expand Down
6 changes: 3 additions & 3 deletions src/ui/qgsadvanceddigitizingdockwidgetbase.ui
Expand Up @@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>252</width>
<height>250</height>
<height>262</height>
</rect>
</property>
<property name="maximumSize">
Expand Down Expand Up @@ -345,7 +345,7 @@
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="label_3">
<widget class="QLabel" name="mLabelX">
<property name="text">
<string>x</string>
</property>
Expand Down Expand Up @@ -399,7 +399,7 @@
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="label_4">
<widget class="QLabel" name="mLabelY">
<property name="text">
<string>y</string>
</property>
Expand Down

0 comments on commit 72367db

Please sign in to comment.