Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 390b145
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
5 changes: 4 additions & 1 deletion src/plugins/coordinate_capture/coordinate_capture.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 9 additions & 5 deletions src/plugins/coordinate_capture/coordinatecapturemaptool.cpp
Expand Up @@ -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()
Expand All @@ -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();
}


Expand Down

0 comments on commit 390b145

Please sign in to comment.