diff --git a/src/app/elevation/qgselevationprofilewidget.cpp b/src/app/elevation/qgselevationprofilewidget.cpp index e58bbeabd317..6c2557b9fecf 100644 --- a/src/app/elevation/qgselevationprofilewidget.cpp +++ b/src/app/elevation/qgselevationprofilewidget.cpp @@ -355,6 +355,16 @@ QgsElevationProfileWidget::QgsElevationProfileWidget( const QString &name ) connect( movePointAction, &QAction::triggered, this, [=] { mCanvas->setTool( mMovePointTool ); } ); toolBar->addAction( movePointAction ); + // show Inflection Lines Action + mShowInflectionLinesAction = new QAction( tr( "Show Inflection Lines" ), this ); + mShowInflectionLinesAction->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mIconLineLayer.svg" ) ) ); + mShowInflectionLinesAction->setCheckable( true ); + mShowInflectionLinesAction->setChecked( false ); + mShowInflectionLinesAction->setEnabled( false ); + connect( mShowInflectionLinesAction, &QAction::triggered, this, [=] { mCanvas->setInflectionLinesEnabled( mShowInflectionLinesAction->isChecked() ); } ); + toolBar->addAction( mShowInflectionLinesAction ); + + toolBar->addSeparator(); QAction *exportAsPdfAction = new QAction( tr( "Export as PDF" ), this ); @@ -706,6 +716,7 @@ void QgsElevationProfileWidget::setProfileCurve( const QgsGeometry &curve, bool { mNudgeLeftAction->setEnabled( !curve.isEmpty() ); mNudgeRightAction->setEnabled( !curve.isEmpty() ); + mShowInflectionLinesAction->setEnabled( !curve.isEmpty() ); mProfileCurve = curve; createOrUpdateRubberBands(); @@ -771,6 +782,7 @@ void QgsElevationProfileWidget::clear() mCanvas->clear(); mNudgeLeftAction->setEnabled( false ); mNudgeRightAction->setEnabled( false ); + mShowInflectionLinesAction->setEnabled( false ); mProfileCurve = QgsGeometry(); } diff --git a/src/app/elevation/qgselevationprofilewidget.h b/src/app/elevation/qgselevationprofilewidget.h index 7474e442c422..51276ae18902 100644 --- a/src/app/elevation/qgselevationprofilewidget.h +++ b/src/app/elevation/qgselevationprofilewidget.h @@ -159,6 +159,7 @@ class QgsElevationProfileWidget : public QWidget QAction *mNudgeRightAction = nullptr; QAction *mRenameProfileAction = nullptr; QAction *mLockRatioAction = nullptr; + QAction *mShowInflectionLinesAction = nullptr; QgsElevationProfileWidgetToggleEditingLayerAction *mToggleEditLayerAction = nullptr; QgsElevationProfileWidgetSaveLayerAction *mSaveLayerAction = nullptr; QgsElevationProfileWidgetDeleteFeaturesAction *mDeleteFeaturesAction = nullptr;