void QgsBullsEyeTool::canvasReleaseEvent( QMouseEvent *e )
{
  if ( mPicking )
  {
    mWidget->centerPicked( toMapCoordinates( e->pos() ) );
    setPicking( false );
  }
  else if ( e->button() == Qt::RightButton )
  {
    canvas()->unsetMapTool( this );
  }
}
void QgsBullsEyeTool::keyReleaseEvent( QKeyEvent *e )
{
  if ( e->key() == Qt::Key_Escape )
  {
    if ( mPicking )
    {
      setPicking( false );
    }
    else
    {
      canvas()->unsetMapTool( this );
    }
  }
}
Пример #3
0
void Mouse(int button, int state, int x, int y)
{
    if((button == GLUT_LEFT_BUTTON) && (state == GLUT_DOWN))
        setPicking(x,wh - y); //Important: gl (0,0) ist bottom left but window coords (0,0) are top left so we have to change this!
}