Quantum GIS API Documentation
1.8
|
00001 /*************************************************************************** 00002 qgsmaptoolemitpoint.cpp - map tool that emits a signal on click 00003 --------------------- 00004 begin : June 2007 00005 copyright : (C) 2007 by Martin Dobias 00006 email : wonder.sk at gmail dot com 00007 *************************************************************************** 00008 * * 00009 * This program is free software; you can redistribute it and/or modify * 00010 * it under the terms of the GNU General Public License as published by * 00011 * the Free Software Foundation; either version 2 of the License, or * 00012 * (at your option) any later version. * 00013 * * 00014 ***************************************************************************/ 00015 00016 00017 #include "qgsmaptoolemitpoint.h" 00018 #include "qgsmapcanvas.h" 00019 #include <QMouseEvent> 00020 00021 00022 QgsMapToolEmitPoint::QgsMapToolEmitPoint( QgsMapCanvas* canvas ) 00023 : QgsMapTool( canvas ) 00024 { 00025 } 00026 00027 void QgsMapToolEmitPoint::canvasMoveEvent( QMouseEvent * e ) 00028 { 00029 Q_UNUSED( e ); 00030 } 00031 00032 void QgsMapToolEmitPoint::canvasPressEvent( QMouseEvent * e ) 00033 { 00034 QgsPoint pnt = toMapCoordinates( e->pos() ); 00035 emit canvasClicked( pnt, e->button() ); 00036 } 00037 00038 void QgsMapToolEmitPoint::canvasReleaseEvent( QMouseEvent * e ) 00039 { 00040 Q_UNUSED( e ); 00041 }