Skip to content

Commit

Permalink
Correctly hide GPS bearing line when unchecking the option
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed May 21, 2020
1 parent 38c8218 commit baec06c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/app/gps/qgsgpsinformationwidget.cpp
Expand Up @@ -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

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

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

0 comments on commit baec06c

Please sign in to comment.