mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
add support for maptool doubleclick events
git-svn-id: http://svn.osgeo.org/qgis/trunk@8542 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
4a6c91f1c7
commit
7384134467
@ -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 @@ protected:
|
||||
//! 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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user