Skip to content

Commit 3498526

Browse files
author
wonder
committed
Added some files which should have been a part of previous commit (r7133)
git-svn-id: http://svn.osgeo.org/qgis/branches/Release-0_8_0@7134 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 5880887 commit 3498526

File tree

3 files changed

+88
-0
lines changed

3 files changed

+88
-0
lines changed

src/gui/qgsmaptoolemitpoint.cpp

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/***************************************************************************
2+
qgsmaptoolemitpoint.cpp - map tool that emits a signal on click
3+
---------------------
4+
begin : June 2007
5+
copyright : (C) 2007 by Martin Dobias
6+
email : wonder.sk at gmail dot com
7+
***************************************************************************
8+
* *
9+
* This program is free software; you can redistribute it and/or modify *
10+
* it under the terms of the GNU General Public License as published by *
11+
* the Free Software Foundation; either version 2 of the License, or *
12+
* (at your option) any later version. *
13+
* *
14+
***************************************************************************/
15+
/* $Id$ */
16+
17+
18+
#include "qgsmaptoolemitpoint.h"
19+
#include "qgsmapcanvas.h"
20+
21+
22+
QgsMapToolEmitPoint::QgsMapToolEmitPoint(QgsMapCanvas* canvas)
23+
: QgsMapTool(canvas)
24+
{
25+
}
26+
27+
void QgsMapToolEmitPoint::canvasMoveEvent(QMouseEvent * e)
28+
{
29+
}
30+
31+
void QgsMapToolEmitPoint::canvasPressEvent(QMouseEvent * e)
32+
{
33+
QgsPoint pnt = toMapCoords(e->pos());
34+
emit gotPoint(pnt, e->button());
35+
}
36+
37+
void QgsMapToolEmitPoint::canvasReleaseEvent(QMouseEvent * e)
38+
{
39+
}

src/gui/qgsmaptoolemitpoint.h

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/***************************************************************************
2+
qgsmaptoolemitpoint.h - map tool that emits a signal on click
3+
---------------------
4+
begin : June 2007
5+
copyright : (C) 2007 by Martin Dobias
6+
email : wonder.sk at gmail dot com
7+
***************************************************************************
8+
* *
9+
* This program is free software; you can redistribute it and/or modify *
10+
* it under the terms of the GNU General Public License as published by *
11+
* the Free Software Foundation; either version 2 of the License, or *
12+
* (at your option) any later version. *
13+
* *
14+
***************************************************************************/
15+
/* $Id$ */
16+
17+
#ifndef QGSMAPTOOLEMITPOINT_H
18+
#define QGSMAPTOOLEMITPOINT_H
19+
20+
#include "qgspoint.h"
21+
#include "qgsmaptool.h"
22+
class QgsMapCanvas;
23+
24+
#include <QObject>
25+
26+
class QgsMapToolEmitPoint : public QObject, public QgsMapTool
27+
{
28+
Q_OBJECT
29+
30+
public:
31+
//! constructor
32+
QgsMapToolEmitPoint(QgsMapCanvas* canvas);
33+
34+
//! Overridden mouse move event
35+
virtual void canvasMoveEvent(QMouseEvent * e);
36+
37+
//! Overridden mouse press event - emits the signal
38+
virtual void canvasPressEvent(QMouseEvent * e);
39+
40+
//! Overridden mouse release event
41+
virtual void canvasReleaseEvent(QMouseEvent * e);
42+
43+
signals:
44+
45+
//! signal emitted on canvas click
46+
void gotPoint(QgsPoint& point, Qt::MouseButton button);
47+
};
48+
49+
#endif

src/plugins/georeferencer/pencil.png

1.77 KB
Loading

0 commit comments

Comments
 (0)