mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-12 00:02:25 -04:00
display menu at the correct position
This commit is contained in:
parent
8839e2fc0c
commit
723df76fba
@ -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 );
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user