Skip to content
Permalink
Browse files

[maptips] fix maptips showing after mouse leave the canvas area

  • Loading branch information
nirvn committed Jul 27, 2018
1 parent 5b28349 commit 07366e8a3cf5d8032299b7972d7388c521368ecd
Showing with 15 additions and 11 deletions.
  1. +15 −11 src/app/qgisapp.cpp
@@ -11739,20 +11739,24 @@ void QgisApp::removeMapToolMessage()
// Show the maptip using tooltip
void QgisApp::showMapTip()
{
QPoint myPointerPos = mMapCanvas->mouseLastXY();

// Make sure there is an active layer before proceeding
QgsMapLayer *mypLayer = mMapCanvas->currentLayer();
if ( mypLayer )
// Only show maptips if the mouse is still over the map canvas when timer is triggered
if ( mMapCanvas->underMouse() )
{
//QgsDebugMsg("Current layer for maptip display is: " + mypLayer->source());
// only process vector layers
if ( mypLayer->type() == QgsMapLayer::VectorLayer )
QPoint myPointerPos = mMapCanvas->mouseLastXY();

// Make sure there is an active layer before proceeding
QgsMapLayer *mypLayer = mMapCanvas->currentLayer();
if ( mypLayer )
{
// Show the maptip if the maptips button is depressed
if ( mMapTipsVisible )
// QgsDebugMsg("Current layer for maptip display is: " + mypLayer->source());
// only process vector layers
if ( mypLayer->type() == QgsMapLayer::VectorLayer )
{
mpMaptip->showMapTip( mypLayer, mLastMapPosition, myPointerPos, mMapCanvas );
// Show the maptip if the maptips button is depressed
if ( mMapTipsVisible )
{
mpMaptip->showMapTip( mypLayer, mLastMapPosition, myPointerPos, mMapCanvas );
}
}
}
}

0 comments on commit 07366e8

Please sign in to comment.
You can’t perform that action at this time.