Skip to content
Permalink
Browse files

add support for maptool doubleclick events

git-svn-id: http://svn.osgeo.org/qgis/trunk@8542 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed May 29, 2008
1 parent 4a6c91f commit 7384134467e7930a16e428971a960493acb54056
Showing with 26 additions and 1 deletion.
  1. +3 −0 python/gui/qgsmaptool.sip
  2. +13 −1 src/gui/qgsmapcanvas.cpp
  3. +3 −0 src/gui/qgsmapcanvas.h
  4. +4 −0 src/gui/qgsmaptool.cpp
  5. +3 −0 src/gui/qgsmaptool.h
@@ -33,6 +33,9 @@ class QgsMapTool : QObject
//! Mouse move event for overriding
virtual void canvasMoveEvent(QMouseEvent * e);

//! Mouse double click event for overriding
virtual void canvasDoubleClickEvent(QMouseEvent * e);

//! Mouse press event for overriding
virtual void canvasPressEvent(QMouseEvent * e);

@@ -703,6 +703,19 @@ void QgsMapCanvas::keyReleaseEvent(QKeyEvent * e)
} //keyReleaseEvent()


void QgsMapCanvas::mouseDoubleClickEvent(QMouseEvent * e)
{
if(mDrawing)
{
return;
}

// call handler of current map tool
if (mMapTool)
mMapTool->canvasDoubleClickEvent(e);
} // mouseDoubleClickEvent


void QgsMapCanvas::mousePressEvent(QMouseEvent * e)
{
if(mDrawing)
@@ -900,7 +913,6 @@ void QgsMapCanvas::zoomWithCenter(int x, int y, bool zoomIn)
refresh();
}


void QgsMapCanvas::mouseMoveEvent(QMouseEvent * e)
{
if(mDrawing)
@@ -307,6 +307,9 @@ class GUI_EXPORT QgsMapCanvas : public QGraphicsView
//! Overridden key release event
void keyReleaseEvent(QKeyEvent * e);

//! Overridden mouse double click event
void mouseDoubleClickEvent(QMouseEvent * e);

//! Overridden mouse move event
void mouseMoveEvent(QMouseEvent * e);

@@ -116,6 +116,10 @@ void QgsMapTool::canvasMoveEvent(QMouseEvent *)
{
}

void QgsMapTool::canvasDoubleClickEvent(QMouseEvent *)
{
}

void QgsMapTool::canvasPressEvent(QMouseEvent *)
{
}
@@ -41,6 +41,9 @@ class GUI_EXPORT QgsMapTool : public QObject
//! Mouse move event for overriding. Default implementation does nothing.
virtual void canvasMoveEvent(QMouseEvent * e);

//! Mouse double click event for overriding. Default implementation does nothing.
virtual void canvasDoubleClickEvent(QMouseEvent * e);

//! Mouse press event for overriding. Default implementation does nothing.
virtual void canvasPressEvent(QMouseEvent * e);

0 comments on commit 7384134

Please sign in to comment.
You can’t perform that action at this time.