Skip to content
Permalink
Browse files
workaround #2239
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@13732 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Jun 14, 2010
1 parent 942ff37 commit c3d4aa3138b95d07d43a4827806077f2c5b23ddb
Showing with 45 additions and 1 deletion.
  1. +24 −1 src/app/qgisapp.cpp
  2. +12 −0 src/app/qgisapp.h
  3. +9 −0 src/app/qgsmaptooladdfeature.cpp
@@ -366,6 +366,9 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,
#ifdef HAVE_QWT
, mpGpsWidget( NULL )
#endif
#ifdef Q_OS_WIN
, mSkipNextContextMenuEvent( 0 )
#endif
{
if ( smInstance )
{
@@ -1926,7 +1929,7 @@ void QgisApp::setTheme( QString theThemeName )
mActionAddToOverview->setIcon( getThemeIcon( "/mActionInOverview.png" ) );
mActionAnnotation->setIcon( getThemeIcon( "/mActionAnnotation.png" ) );
mActionFormAnnotation->setIcon( getThemeIcon( "/mActionFormAnnotation.png" ) );
mActionTextAnnotation->setIcon( getThemeIcon( "/mActionTextAnnotation.png" ) );
mActionTextAnnotation->setIcon( getThemeIcon( "/mActionTextAnnotation.png" ) );

//change themes of all composers
QSet<QgsComposer*>::iterator composerIt = mPrintComposers.begin();
@@ -6365,6 +6368,26 @@ void QgisApp::keyPressEvent( QKeyEvent * e )
}
}

#ifdef Q_OS_WIN
// hope your wearing your peril sensitive sunglasses.
void QgisApp::contextMenuEvent( QContextMenuEvent *e )
{
if ( mSkipNextContextMenuEvent )
{
mSkipNextContextMenuEvent--;
e->ignore();
return;
}

QMainWindow::contextMenuEvent( e );
}

void QgisApp::skipNextContextMenuEvent()
{
mSkipNextContextMenuEvent++;
}
#endif

// Debug hook - used to output diagnostic messages when evoked (usually from the menu)
/* Temporarily disabled...
void QgisApp::debugHook()
@@ -359,6 +359,11 @@ class QgisApp : public QMainWindow
//! returns pointer to map legend
QgsLegend *legend();

#if Q_OS_WIN
//! ugly hack
void skipNextContextMenuEvent();
#endif

public slots:
//! Zoom to full extent
void zoomFull();
@@ -433,6 +438,9 @@ class QgisApp : public QMainWindow
//! reimplements widget keyPress event so we can check if cancel was pressed
virtual void keyPressEvent( QKeyEvent * event );

//! reimplements context menu event
virtual void contextMenuEvent( QContextMenuEvent *event );

private slots:
//! About QGis
void about();
@@ -1117,6 +1125,10 @@ class QgisApp : public QMainWindow

int mLastComposerId;

#ifdef Q_OS_WIN
int mSkipNextContextMenuEvent; // ugly hack
#endif

#ifdef HAVE_QWT
//! Persistent GPS toolbox
QgsGPSInformationWidget * mpGpsWidget;
@@ -31,6 +31,10 @@
#include <QMouseEvent>
#include <QSettings>

#ifdef Q_OS_WIN
#include <qgisapp.h>
#endif

QgsMapToolAddFeature::QgsMapToolAddFeature( QgsMapCanvas* canvas, CaptureMode tool ): QgsMapToolCapture( canvas, tool )
{

@@ -482,6 +486,11 @@ void QgsMapToolAddFeature::canvasReleaseEvent( QMouseEvent * e )
vlayer->endEditCommand();
}
mypDialog->deleteLater();

#ifdef Q_OS_WIN
// hope your wearing your peril sensitive sunglasses.
QgisApp::instance()->skipNextContextMenuEvent();
#endif
}
delete f;

0 comments on commit c3d4aa3

Please sign in to comment.