Skip to content
Permalink
Browse files

Correctly hide GPS bearing line when unchecking the option

  • Loading branch information
nyalldawson committed May 21, 2020
1 parent 38c8218 commit baec06ce4fb02411f54cb23179388e50cf8e60ad
Showing with 12 additions and 1 deletion.
  1. +12 −1 src/app/gps/qgsgpsinformationwidget.cpp
@@ -319,6 +319,17 @@ QgsGpsInformationWidget::QgsGpsInformationWidget( QgsMapCanvas *mapCanvas, QWidg
mRotateMapCheckBox->setChecked( mySettings.value( QStringLiteral( "gps/rotateMap" ), false ).toBool() );
mSpinMapRotateInterval->setValue( mySettings.value( QStringLiteral( "gps/rotateMapInterval" ), 0 ).toInt() );
mShowBearingLineCheck->setChecked( mySettings.value( QStringLiteral( "gps/showBearingLine" ), false ).toBool() );
connect( mShowBearingLineCheck, &QgsCollapsibleGroupBox::toggled, this, [ = ]( bool checked )
{
if ( !checked )
{
if ( mMapBearingItem )
{
delete mMapBearingItem;
mMapBearingItem = nullptr;
}
}
} );

mBtnDebug->setVisible( mySettings.value( QStringLiteral( "gps/showDebug" ), "false" ).toBool() ); // use a registry setting to control - power users/devs could set it

@@ -984,7 +995,7 @@ void QgsGpsInformationWidget::displayGPSInformation( const QgsGpsInformation &in
mLastRotateTimer.restart();
}

if ( mShowBearingLineCheck )
if ( mShowBearingLineCheck->isChecked() )
{
if ( ! mMapBearingItem )
{

0 comments on commit baec06c

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