Hello!

I've got simple application in which I need to use 4 keyboard keys (arrows) to move point on my widget. I've got something like this in main window:

Qt Code:
  1. void MainWindow::keyPressEvent( QKeyEvent *k )
  2. {
  3. switch ( k->key() )
  4. {
  5. case Qt::Key_Up:
  6. qDebug() << "UP";
  7. break;
  8. case Qt::Key_Down:
  9. qDebug() << "DOWN";
  10. break;
  11. case Qt::Key_Left:
  12. qDebug() << "LEFT";
  13. break;
  14. case Qt::Key_Right:
  15. qDebug() << "RIGHT";
  16. break;
  17. default:
  18. qDebug() << k->key() << endl;
  19. break;
  20. }
  21. }
To copy to clipboard, switch view to plain text mode 

Inside I wanted to put function which changes coordinates of point inside widget. But only up/down keys works (prompt goes to first text edit window). How can I make it other way? I've read about qshortcuts but I don't know if I can use it (it can by shortcuts to real buttons on my application - then I'll make them).

thanks in advance
best regards
Tomasz