I'm using the following function:

Qt Code:
  1. void Clone::keyPressEvent( QKeyEvent *event)
  2. {
  3. switch ( kbdItem)
  4. {
  5. case getDriveLetter:
  6. driveLetterProcess( event->text());
  7. break;
  8. case okNotMounted:
  9. notMountedProcess();
  10. break;
  11. case okDeleteFolder:
  12. deleteFolderProcess( event->key());
  13. break;
  14. default:
  15. ;
  16. }
  17. }
To copy to clipboard, switch view to plain text mode 

If I press the spacebar, the function ignores the input for the getDriveLetter and okDeleteFolder cases.

For the okNotMounted case, I ask the user to, "Press any key to continue." If spacebar is selected, rather then entering the notMountedProcess(), the function re-enters the driveLetterProcess( event->text()).

Works fine for any other key press.