Skip to content

Commit 07366e8

Browse files
committedJul 27, 2018
[maptips] fix maptips showing after mouse leave the canvas area
1 parent 5b28349 commit 07366e8

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed
 

‎src/app/qgisapp.cpp

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11739,20 +11739,24 @@ void QgisApp::removeMapToolMessage()
1173911739
// Show the maptip using tooltip
1174011740
void QgisApp::showMapTip()
1174111741
{
11742-
QPoint myPointerPos = mMapCanvas->mouseLastXY();
11743-
11744-
// Make sure there is an active layer before proceeding
11745-
QgsMapLayer *mypLayer = mMapCanvas->currentLayer();
11746-
if ( mypLayer )
11742+
// Only show maptips if the mouse is still over the map canvas when timer is triggered
11743+
if ( mMapCanvas->underMouse() )
1174711744
{
11748-
//QgsDebugMsg("Current layer for maptip display is: " + mypLayer->source());
11749-
// only process vector layers
11750-
if ( mypLayer->type() == QgsMapLayer::VectorLayer )
11745+
QPoint myPointerPos = mMapCanvas->mouseLastXY();
11746+
11747+
// Make sure there is an active layer before proceeding
11748+
QgsMapLayer *mypLayer = mMapCanvas->currentLayer();
11749+
if ( mypLayer )
1175111750
{
11752-
// Show the maptip if the maptips button is depressed
11753-
if ( mMapTipsVisible )
11751+
// QgsDebugMsg("Current layer for maptip display is: " + mypLayer->source());
11752+
// only process vector layers
11753+
if ( mypLayer->type() == QgsMapLayer::VectorLayer )
1175411754
{
11755-
mpMaptip->showMapTip( mypLayer, mLastMapPosition, myPointerPos, mMapCanvas );
11755+
// Show the maptip if the maptips button is depressed
11756+
if ( mMapTipsVisible )
11757+
{
11758+
mpMaptip->showMapTip( mypLayer, mLastMapPosition, myPointerPos, mMapCanvas );
11759+
}
1175611760
}
1175711761
}
1175811762
}

0 commit comments

Comments
 (0)
Please sign in to comment.