Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
remove Windows OS specific event filter that eats context menu events
- Loading branch information
Showing
with
0 additions
and
34 deletions.
-
+0
−27
src/gui/qgsmaptoolcapture.cpp
-
+0
−7
src/gui/qgsmaptoolcapture.h
|
@@ -41,9 +41,6 @@ |
|
|
QgsMapToolCapture::QgsMapToolCapture( QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget, CaptureMode mode ) |
|
|
: QgsMapToolAdvancedDigitizing( canvas, cadDockWidget ) |
|
|
, mCaptureMode( mode ) |
|
|
#ifdef Q_OS_WIN |
|
|
, mSkipNextContextMenuEvent( 0 ) |
|
|
#endif |
|
|
{ |
|
|
mCaptureModeFromLayer = mode == CaptureNone; |
|
|
mCapturing = false; |
|
@@ -640,18 +637,6 @@ void QgsMapToolCapture::stopCapturing() |
|
|
|
|
|
mTracingStartPoint = QgsPointXY(); |
|
|
|
|
|
#ifdef Q_OS_WIN |
|
|
Q_FOREACH ( QWidget *w, qApp->topLevelWidgets() ) |
|
|
{ |
|
|
if ( w->objectName() == "QgisApp" ) |
|
|
{ |
|
|
if ( mSkipNextContextMenuEvent++ == 0 ) |
|
|
w->installEventFilter( this ); |
|
|
break; |
|
|
} |
|
|
} |
|
|
#endif |
|
|
|
|
|
mCapturing = false; |
|
|
mCaptureCurve.clear(); |
|
|
mSnappingMatches.clear(); |
|
@@ -783,15 +768,3 @@ void QgsMapToolCapture::setPoints( const QVector<QgsPointXY> &pointList ) |
|
|
mSnappingMatches.append( QgsPointLocator::Match() ); |
|
|
} |
|
|
|
|
|
#ifdef Q_OS_WIN |
|
|
bool QgsMapToolCapture::eventFilter( QObject *obj, QEvent *event ) |
|
|
{ |
|
|
if ( event->type() != QEvent::ContextMenu ) |
|
|
return false; |
|
|
|
|
|
if ( --mSkipNextContextMenuEvent == 0 ) |
|
|
obj->removeEventFilter( this ); |
|
|
|
|
|
return mSkipNextContextMenuEvent >= 0; |
|
|
} |
|
|
#endif |
|
@@ -97,10 +97,6 @@ class GUI_EXPORT QgsMapToolCapture : public QgsMapToolAdvancedDigitizing |
|
|
*/ |
|
|
void keyPressEvent( QKeyEvent *e ) override; |
|
|
|
|
|
#ifdef Q_OS_WIN |
|
|
virtual bool eventFilter( QObject *obj, QEvent *e ) override; |
|
|
#endif |
|
|
|
|
|
/** |
|
|
* Clean a temporary rubberband |
|
|
*/ |
|
@@ -261,9 +257,6 @@ class GUI_EXPORT QgsMapToolCapture : public QgsMapToolAdvancedDigitizing |
|
|
|
|
|
friend class TestQgsMapToolReshape; |
|
|
|
|
|
#ifdef Q_OS_WIN |
|
|
int mSkipNextContextMenuEvent; |
|
|
#endif |
|
|
}; |
|
|
|
|
|
#endif |