Skip to content
Permalink
Browse files
use a better cursor
git-svn-id: http://svn.osgeo.org/qgis/trunk@9000 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Aug 6, 2008
1 parent 65c5bf4 commit 390b145396befefae3728b8c8077fdbda0e7d26c
@@ -15,7 +15,10 @@
inkscape:version="0.46"
version="1.0"
sodipodi:docname="coordinate_capture.svg"
inkscape:output_extension="org.inkscape.output.svg.inkscape">
inkscape:output_extension="org.inkscape.output.svg.inkscape"
inkscape:export-filename="/home/timlinux/dev/cpp/qgis/src/plugins/coordinate_capture/coordinatecapture.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90">
<defs
id="defs4">
<marker
@@ -31,10 +31,12 @@ CoordinateCaptureMapTool::CoordinateCaptureMapTool(QgsMapCanvas* thepCanvas)
: QgsMapTool(thepCanvas)
{
// set cursor
QPixmap myIdentifyCursor = QPixmap((const char **) identify_cursor);
QPixmap myIdentifyCursor = QPixmap((const char **) capture_point_cursor);
mCursor = QCursor(myIdentifyCursor, 1, 1);
mpMapCanvas = thepCanvas;
mpRubberBand = new QgsRubberBand(mpMapCanvas,false); //false - not a polygon
mpRubberBand->setColor(Qt::red);
mpRubberBand->setWidth(3);
}

CoordinateCaptureMapTool::~CoordinateCaptureMapTool()
@@ -58,13 +60,15 @@ void CoordinateCaptureMapTool::canvasReleaseEvent(QMouseEvent * thepEvent)
return;
}

mpRubberBand->reset(false);

// convert screen coordinates to map coordinates
QgsPoint myPoint =
mCanvas->getCoordinateTransform()->toMapCoordinates(thepEvent->x(), thepEvent->y());
mpRubberBand->addPoint(myPoint,true); //true - update canvas
emit pointCaptured(myPoint);
mpRubberBand->reset(false);
// convert screen coordinates to map coordinates
mpRubberBand->addPoint(myPoint,false); //true - update canvas
mpRubberBand->addPoint(myPoint,false); //true - update canvas
mpRubberBand->addPoint(myPoint,false); //true - update canvas
mpRubberBand->show();
}


0 comments on commit 390b145

Please sign in to comment.