Skip to content

Commit cefb1bc

Browse files
stevenmizunonyalldawson
authored andcommitted
remove Windows OS specific event filter that eats context menu events
fixes #17453
1 parent 09fbdb1 commit cefb1bc

File tree

2 files changed

+0
-34
lines changed

2 files changed

+0
-34
lines changed

src/gui/qgsmaptoolcapture.cpp

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@
4141
QgsMapToolCapture::QgsMapToolCapture( QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget, CaptureMode mode )
4242
: QgsMapToolAdvancedDigitizing( canvas, cadDockWidget )
4343
, mCaptureMode( mode )
44-
#ifdef Q_OS_WIN
45-
, mSkipNextContextMenuEvent( 0 )
46-
#endif
4744
{
4845
mCaptureModeFromLayer = mode == CaptureNone;
4946
mCapturing = false;
@@ -640,18 +637,6 @@ void QgsMapToolCapture::stopCapturing()
640637

641638
mTracingStartPoint = QgsPointXY();
642639

643-
#ifdef Q_OS_WIN
644-
Q_FOREACH ( QWidget *w, qApp->topLevelWidgets() )
645-
{
646-
if ( w->objectName() == "QgisApp" )
647-
{
648-
if ( mSkipNextContextMenuEvent++ == 0 )
649-
w->installEventFilter( this );
650-
break;
651-
}
652-
}
653-
#endif
654-
655640
mCapturing = false;
656641
mCaptureCurve.clear();
657642
mSnappingMatches.clear();
@@ -783,15 +768,3 @@ void QgsMapToolCapture::setPoints( const QVector<QgsPointXY> &pointList )
783768
mSnappingMatches.append( QgsPointLocator::Match() );
784769
}
785770

786-
#ifdef Q_OS_WIN
787-
bool QgsMapToolCapture::eventFilter( QObject *obj, QEvent *event )
788-
{
789-
if ( event->type() != QEvent::ContextMenu )
790-
return false;
791-
792-
if ( --mSkipNextContextMenuEvent == 0 )
793-
obj->removeEventFilter( this );
794-
795-
return mSkipNextContextMenuEvent >= 0;
796-
}
797-
#endif

src/gui/qgsmaptoolcapture.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,6 @@ class GUI_EXPORT QgsMapToolCapture : public QgsMapToolAdvancedDigitizing
9797
*/
9898
void keyPressEvent( QKeyEvent *e ) override;
9999

100-
#ifdef Q_OS_WIN
101-
virtual bool eventFilter( QObject *obj, QEvent *e ) override;
102-
#endif
103-
104100
/**
105101
* Clean a temporary rubberband
106102
*/
@@ -261,9 +257,6 @@ class GUI_EXPORT QgsMapToolCapture : public QgsMapToolAdvancedDigitizing
261257

262258
friend class TestQgsMapToolReshape;
263259

264-
#ifdef Q_OS_WIN
265-
int mSkipNextContextMenuEvent;
266-
#endif
267260
};
268261

269262
#endif

0 commit comments

Comments
 (0)