Skip to content

Commit 4374893

Browse files
committed
Merge pull request #681 from 3nids/maptoolcursor
set cursor for mapTools
2 parents 8dc28f2 + f4a4009 commit 4374893

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

python/gui/qgsmaptool.sip

+3
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ class QgsMapTool : QObject
8383
/** Return associated button with map tool or NULL if no button is associated */
8484
QAbstractButton* button();
8585

86+
/** Set a user defined cursor */
87+
virtual void setCursor(QCursor cursor);
88+
8689
/** Check whether this MapTool performs a zoom or pan operation.
8790
* If it does, we will be able to perform the zoom and then
8891
* resume operations with the original / previously used tool.*/

src/gui/qgsmaptool.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,11 @@ QAbstractButton* QgsMapTool::button()
110110
return mButton;
111111
}
112112

113+
void QgsMapTool::setCursor(QCursor cursor)
114+
{
115+
mCursor = cursor;
116+
}
117+
113118

114119
void QgsMapTool::canvasMoveEvent( QMouseEvent *e )
115120
{

src/gui/qgsmaptool.h

+3
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ class GUI_EXPORT QgsMapTool : public QObject
9898
/** Return associated button with map tool or NULL if no button is associated */
9999
QAbstractButton* button();
100100

101+
/** Set a user defined cursor */
102+
virtual void setCursor(QCursor cursor);
103+
101104
/** Check whether this MapTool performs a zoom or pan operation.
102105
* If it does, we will be able to perform the zoom and then
103106
* resume operations with the original / previously used tool.*/

0 commit comments

Comments
 (0)