Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Simpler code
  • Loading branch information
nyalldawson committed Jan 17, 2023
1 parent a8d5691 commit 1aef037
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/gui/layout/qgslayoutelevationprofilewidget.cpp
Expand Up @@ -385,14 +385,17 @@ QgsLayoutElevationProfileWidget::QgsLayoutElevationProfileWidget( QgsLayoutItemE

if ( mProfile->layout() )
{
connect( &mProfile->layout()->reportContext(), &QgsLayoutReportContext::layerChanged, mDistanceAxisMajorLinesSymbolButton, &QgsSymbolButton::setLayer );
connect( &mProfile->layout()->reportContext(), &QgsLayoutReportContext::layerChanged, mDistanceAxisMinorLinesSymbolButton, &QgsSymbolButton::setLayer );
connect( &mProfile->layout()->reportContext(), &QgsLayoutReportContext::layerChanged, mElevationAxisMajorLinesSymbolButton, &QgsSymbolButton::setLayer );
connect( &mProfile->layout()->reportContext(), &QgsLayoutReportContext::layerChanged, mElevationAxisMinorLinesSymbolButton, &QgsSymbolButton::setLayer );
connect( &mProfile->layout()->reportContext(), &QgsLayoutReportContext::layerChanged, mDistanceAxisLabelFontButton, &QgsFontButton::setLayer );
connect( &mProfile->layout()->reportContext(), &QgsLayoutReportContext::layerChanged, mElevationAxisLabelFontButton, &QgsFontButton::setLayer );
connect( &mProfile->layout()->reportContext(), &QgsLayoutReportContext::layerChanged, mChartBackgroundSymbolButton, &QgsSymbolButton::setLayer );
connect( &mProfile->layout()->reportContext(), &QgsLayoutReportContext::layerChanged, mChartBorderSymbolButton, &QgsSymbolButton::setLayer );
connect( &mProfile->layout()->reportContext(), &QgsLayoutReportContext::layerChanged, this, [ = ]( QgsVectorLayer * layer )
{
mDistanceAxisMajorLinesSymbolButton->setLayer( layer );
mDistanceAxisMinorLinesSymbolButton->setLayer( layer );
mElevationAxisMajorLinesSymbolButton->setLayer( layer );
mElevationAxisMinorLinesSymbolButton->setLayer( layer );
mDistanceAxisLabelFontButton->setLayer( layer );
mElevationAxisLabelFontButton->setLayer( layer );
mChartBackgroundSymbolButton->setLayer( layer );
mChartBorderSymbolButton->setLayer( layer );
} );
}
}

Expand Down

0 comments on commit 1aef037

Please sign in to comment.