Quantum GIS API Documentation
1.7.4
|
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 /* $Id$ */ 00016 00017 00018 #include "qgsmaptoolemitpoint.h" 00019 #include "qgsmapcanvas.h" 00020 #include <QMouseEvent> 00021 00022 00023 QgsMapToolEmitPoint::QgsMapToolEmitPoint( QgsMapCanvas* canvas ) 00024 : QgsMapTool( canvas ) 00025 { 00026 } 00027 00028 void QgsMapToolEmitPoint::canvasMoveEvent( QMouseEvent * e ) 00029 { 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 }