From ca2adedc096c2dbaa748bd259d909e5f3510a91b Mon Sep 17 00:00:00 2001 From: Mathieu Pellerin Date: Wed, 31 Jul 2024 10:23:28 +0700 Subject: [PATCH] [cad] Make 2-circle intersection tool's digitizing buttons mutually exclusive --- src/gui/qgsadvanceddigitizingtools.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/gui/qgsadvanceddigitizingtools.cpp b/src/gui/qgsadvanceddigitizingtools.cpp index 11c4aeeaf020..4b2ee0410071 100644 --- a/src/gui/qgsadvanceddigitizingtools.cpp +++ b/src/gui/qgsadvanceddigitizingtools.cpp @@ -49,6 +49,13 @@ QWidget *QgsAdvancedDigitizingCirclesIntersectionTool::createWidget() mCircle1Digitize->setCheckable( true ); mCircle1Digitize->setChecked( false ); mCircle1Digitize->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionMapIdentification.svg" ) ) ); + connect( mCircle1Digitize, &QAbstractButton::toggled, this, [ = ]( bool checked ) + { + if ( checked ) + { + mCircle2Digitize->setChecked( false ); + } + } ); layout->addWidget( mCircle1Digitize, 1, 2, 2, 1 ); label = new QLabel( QStringLiteral( "X" ), toolWidget ); @@ -85,6 +92,13 @@ QWidget *QgsAdvancedDigitizingCirclesIntersectionTool::createWidget() mCircle2Digitize->setCheckable( true ); mCircle2Digitize->setChecked( false ); mCircle2Digitize->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionMapIdentification.svg" ) ) ); + connect( mCircle2Digitize, &QAbstractButton::toggled, this, [ = ]( bool checked ) + { + if ( checked ) + { + mCircle1Digitize->setChecked( false ); + } + } ); layout->addWidget( mCircle2Digitize, 5, 2, 2, 1 ); label = new QLabel( QStringLiteral( "X" ), toolWidget );