Skip to content

Commit

Permalink
qgselevationprofilewidget: Add an action to enable inflection lines
Browse files Browse the repository at this point in the history
  • Loading branch information
ptitjano committed Feb 13, 2025
1 parent 9574723 commit e6e94f2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/app/elevation/qgselevationprofilewidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -771,6 +782,7 @@ void QgsElevationProfileWidget::clear()
mCanvas->clear();
mNudgeLeftAction->setEnabled( false );
mNudgeRightAction->setEnabled( false );
mShowInflectionLinesAction->setEnabled( false );
mProfileCurve = QgsGeometry();
}

Expand Down
1 change: 1 addition & 0 deletions src/app/elevation/qgselevationprofilewidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e6e94f2

Please # to comment.