Skip to content

Commit

Permalink
Fix crash when settings-options is accepted when 3d view is open
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jan 10, 2022
1 parent 3bc1338 commit a219d28
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/app/3d/qgs3dmaptoolmeasureline.cpp
Expand Up @@ -169,13 +169,16 @@ void Qgs3DMapToolMeasureLine::handleClick( Qt3DRender::QPickEvent *event, const

void Qgs3DMapToolMeasureLine::updateSettings()
{
const QgsSettings settings;
const int myRed = settings.value( QStringLiteral( "qgis/default_measure_color_red" ), 222 ).toInt();
const int myGreen = settings.value( QStringLiteral( "qgis/default_measure_color_green" ), 155 ).toInt();
const int myBlue = settings.value( QStringLiteral( "qgis/default_measure_color_blue" ), 67 ).toInt();
if ( mRubberBand )
{
const QgsSettings settings;
const int myRed = settings.value( QStringLiteral( "qgis/default_measure_color_red" ), 222 ).toInt();
const int myGreen = settings.value( QStringLiteral( "qgis/default_measure_color_green" ), 155 ).toInt();
const int myBlue = settings.value( QStringLiteral( "qgis/default_measure_color_blue" ), 67 ).toInt();

mRubberBand->setWidth( 3 );
mRubberBand->setColor( QColor( myRed, myGreen, myBlue ) );
mRubberBand->setWidth( 3 );
mRubberBand->setColor( QColor( myRed, myGreen, myBlue ) );
}
}

void Qgs3DMapToolMeasureLine::addPoint( const QgsPoint &point )
Expand Down

0 comments on commit a219d28

Please sign in to comment.