Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
SIP_SKIP and tidy
  • Loading branch information
elpaso committed May 4, 2023
1 parent fa5de44 commit 34933d0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
Expand Up @@ -1049,12 +1049,6 @@ Emitted whenever the snapping to common angle option changes, angle = 0 means th
.. versionadded:: 3.32
%End

void commonAngleSnappingShowInFloaterChanged( bool enabled );
%Docstring
Emitted whenever the option to show common angle snapping in the floater changes.

.. versionadded:: 3.32
%End

private:
//! event filter for line edits in the dock UI (angle/distance/x/y line edits)
Expand Down
9 changes: 8 additions & 1 deletion src/gui/qgsadvanceddigitizingdockwidget.cpp
Expand Up @@ -124,7 +124,11 @@ QgsAdvancedDigitizingDockWidget::QgsAdvancedDigitizingDockWidget( QgsMapCanvas *
mCommonAngleActionsMenu->addAction( showCommonAngleSnappingInFloaterAction );

// common angles
QActionGroup *angleButtonGroup = new QActionGroup( mCommonAngleActionsMenu ); // actions are exclusive for common angles

// Suppress warning: Potential leak of memory pointed to by 'angleButtonGroup' [clang-analyzer-cplusplus.NewDeleteLeaks]
#ifndef __clang_analyzer__
QActionGroup *angleButtonGroup = new QActionGroup( mCommonAngleActionsMenu ); // actions are exclusive for common angles NOLINT
#endif
mCommonAngleActions = QMap<QAction *, double>();
QList< QPair< double, QString > > commonAngles;
const QList<double> anglesDouble( { 0.0, 0.1, 0.5, 1.0, 5.0, 10.0, 15.0, 18.0, 22.5, 30.0, 45.0, 90.0} );
Expand All @@ -138,7 +142,10 @@ QgsAdvancedDigitizingDockWidget::QgsAdvancedDigitizingDockWidget( QgsMapCanvas *
action->setCheckable( true );
action->setChecked( it->first == mCommonAngleConstraint );
mCommonAngleActionsMenu->addAction( action );
// Suppress warning: Potential leak of memory pointed to by 'angleButtonGroup' [clang-analyzer-cplusplus.NewDeleteLeaks]
#ifndef __clang_analyzer__
angleButtonGroup->addAction( action );
#endif
mCommonAngleActions.insert( action, it->first );
}

Expand Down
3 changes: 2 additions & 1 deletion src/gui/qgsadvanceddigitizingdockwidget.h
Expand Up @@ -881,8 +881,9 @@ class GUI_EXPORT QgsAdvancedDigitizingDockWidget : public QgsDockWidget, private
/**
* Emitted whenever the option to show common angle snapping in the floater changes.
* \since QGIS 3.32
* \note Not available in Python bindings
*/
void commonAngleSnappingShowInFloaterChanged( bool enabled );
void commonAngleSnappingShowInFloaterChanged( bool enabled ) SIP_SKIP;

private slots:
//! Sets the between line constraint by clicking on the perpendicular/parallel buttons
Expand Down

0 comments on commit 34933d0

Please sign in to comment.