Skip to content

Commit

Permalink
Added QgsMapTool::keyReleaseEvent()
Browse files Browse the repository at this point in the history
Added missing binding for QgsMapTool::keyPressEvent()
 ... will ever people add the bindings for newly added functions? :-/



git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@10118 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Feb 6, 2009
1 parent de00895 commit 6feda5f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
8 changes: 8 additions & 0 deletions python/gui/qgsmaptool.sip
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,15 @@ class QgsMapTool : QObject

//! Mouse release event for overriding
virtual void canvasReleaseEvent(QMouseEvent * e);

//! Key press for overriding
//! (binding) added in version 1.1
virtual void keyPressEvent(QKeyEvent * e);

//! Key press for overriding
//! Added in version 1.1
virtual void keyReleaseEvent(QKeyEvent * e);

//! Called when rendering has finished
virtual void renderComplete();

Expand Down
5 changes: 5 additions & 0 deletions src/gui/qgsmapcanvas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,11 @@ void QgsMapCanvas::keyReleaseEvent( QKeyEvent * e )

default:
// Pass it on
if ( mMapTool )
{
mMapTool->keyReleaseEvent( e );
}

e->ignore();

QgsDebugMsg( "Ignoring key release: " + QString::number( e->key() ) );
Expand Down
4 changes: 4 additions & 0 deletions src/gui/qgsmaptool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ void QgsMapTool::keyPressEvent( QKeyEvent* e )
{
}

void QgsMapTool::keyReleaseEvent( QKeyEvent* e )
{
}

void QgsMapTool::renderComplete()
{
}
Expand Down
4 changes: 4 additions & 0 deletions src/gui/qgsmaptool.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ class GUI_EXPORT QgsMapTool : public QObject
//! Key event for overriding. Default implementation does nothing.
virtual void keyPressEvent( QKeyEvent* e );

//! Key event for overriding. Default implementation does nothing.
//! Added in version 1.1
virtual void keyReleaseEvent( QKeyEvent* e );

//! Called when rendering has finished. Default implementation does nothing.
virtual void renderComplete();

Expand Down

0 comments on commit 6feda5f

Please sign in to comment.