mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-18 00:03:05 -04:00
use a better cursor
git-svn-id: http://svn.osgeo.org/qgis/trunk@9000 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
65c5bf4462
commit
390b145396
@ -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
|
||||
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 4.1 KiB |
@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user