Skip to content

Commit 4718d34

Browse files
author
wonder
committed
- fix to enable custom map canvas item positioning
- QAction of map tool now gets unchecked when tool has been deactivated even if it's in another action group git-svn-id: http://svn.osgeo.org/qgis/trunk@5154 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 7e91f56 commit 4718d34

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

src/gui/qgsmapcanvasitem.h

+2-6
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,11 @@ class QgsMapCanvasItem : public QObject, public Q3CanvasRectangle
5757

5858
//! transformation from map coordinates to screen coordinates
5959
QPoint toCanvasCoords(const QgsPoint& point);
60-
61-
62-
63-
public slots:
64-
60+
6561
/** called on changed extents or changed item rectangle
6662
* Override this in your subclass if you wish to have custom
6763
* behaviour for when the canvas area of interest is changed */
68-
void updatePosition();
64+
virtual void updatePosition();
6965

7066
protected:
7167

src/gui/qgsmaptool.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,15 @@ void QgsMapTool::activate()
4848
{
4949
// make action active
5050
if (mAction)
51-
mAction->setOn(true);
51+
mAction->setChecked(true);
5252

53-
// set cursor (map tools usually set it in constructor
53+
// set cursor (map tools usually set it in constructor)
5454
mCanvas->setCursor(mCursor);
5555
}
5656

5757

5858
void QgsMapTool::deactivate()
5959
{
60+
if (mAction)
61+
mAction->setChecked(false);
6062
}

0 commit comments

Comments
 (0)