Skip to content
Permalink
Browse files

display menu at the correct position

  • Loading branch information
signedav committed Oct 18, 2018
1 parent 8839e2f commit 723df76fba1ec70c3db508449a72d3ad685de595
Showing with 5 additions and 4 deletions.
  1. +4 −3 src/app/qgsmaptoolfeatureaction.cpp
  2. +1 −1 src/app/qgsmaptoolfeatureaction.h
@@ -75,7 +75,7 @@ void QgsMapToolFeatureAction::canvasReleaseEvent( QgsMapMouseEvent *e )
return;
}

if ( !doAction( vlayer, e->x(), e->y(), e->originalPixelPoint() ) )
if ( !doAction( vlayer, e->x(), e->y() ) )
QgisApp::instance()->statusBarIface()->showMessage( tr( "No features at this position found." ) );
}

@@ -89,12 +89,13 @@ void QgsMapToolFeatureAction::deactivate()
QgsMapTool::deactivate();
}

bool QgsMapToolFeatureAction::doAction( QgsVectorLayer *layer, int x, int y, QPoint pixelpos )
bool QgsMapToolFeatureAction::doAction( QgsVectorLayer *layer, int x, int y )
{
if ( !layer )
return false;

QgsPointXY point = mCanvas->getCoordinateTransform()->toMapCoordinates( x, y );
QPoint position = mCanvas->mapToGlobal( QPoint( x + 5, y + 5 ) );

QgsRectangle r;

@@ -151,7 +152,7 @@ bool QgsMapToolFeatureAction::doAction( QgsVectorLayer *layer, int x, int y, QPo
}
} );

featureMenu->exec( pixelpos );
featureMenu->exec( position );
}
return true;
}
@@ -52,7 +52,7 @@ class APP_EXPORT QgsMapToolFeatureAction : public QgsMapTool
void deactivate() override;

private:
bool doAction( QgsVectorLayer *layer, int x, int y, QPoint pixelpos );
bool doAction( QgsVectorLayer *layer, int x, int y );
void doActionForFeature( QgsVectorLayer *layer, QgsFeature feat, QgsPointXY point );
};

0 comments on commit 723df76

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