Skip to content

Commit 1b1c88b

Browse files
author
homann
committed
Changed to a custom cross hair mouse pointer when using measurement tool. Fixes #862
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@7770 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 0ba25e4 commit 1b1c88b

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

src/app/qgsmeasuretool.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
#include "qgsmeasuredialog.h"
2525
#include "qgsmeasuretool.h"
26+
#include "qgscursors.h"
2627

2728
#include <QMessageBox>
2829
#include <QSettings>
@@ -34,7 +35,8 @@ QgsMeasureTool::QgsMeasureTool(QgsMapCanvas* canvas, bool measureArea)
3435

3536
mRubberBand = new QgsRubberBand(canvas, mMeasureArea);
3637

37-
mCanvas->setCursor(Qt::CrossCursor);
38+
QPixmap myCrossHairQPixmap = QPixmap((const char **) cross_hair_cursor);
39+
mCursor = QCursor(myCrossHairQPixmap, 8, 8);
3840

3941
mRightMouseClicked = false;
4042

src/gui/qgscursors.cpp

+23
Original file line numberDiff line numberDiff line change
@@ -147,3 +147,26 @@ const char *identify_cursor[] = {
147147
"############.a.#",
148148
"#############.##"
149149
};
150+
151+
const char *cross_hair_cursor[] = {
152+
"16 16 3 1",
153+
" » c None",
154+
".» c #000000",
155+
"+» c #FFFFFF",
156+
" ",
157+
" +.+ ",
158+
" +.+ ",
159+
" +.+ ",
160+
" +.+ ",
161+
" +.+ ",
162+
" . ",
163+
" +++++ +++++",
164+
" ...... ......",
165+
" +++++ +++++",
166+
" . ",
167+
" +.+ ",
168+
" +.+ ",
169+
" +.+ ",
170+
" +.+ ",
171+
" +.+ "};
172+

src/gui/qgscursors.h

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ extern GUI_EXPORT const unsigned char pan_mask_bits[];
2727
extern GUI_EXPORT const char *capture_point_cursor[];
2828
extern GUI_EXPORT const char *select_cursor[];
2929
extern GUI_EXPORT const char *identify_cursor[];
30+
extern GUI_EXPORT const char *cross_hair_cursor[];
3031

3132
#endif
3233

0 commit comments

Comments
 (0)