I have a class that doesn't seem to override the keyPressEvent properly, or at least, the function isn't getting called.

It inherits from QDialog

Qt Code:
  1. class SelectionDialog : public QDialog
To copy to clipboard, switch view to plain text mode 

As a public function, it has:

Qt Code:
  1. void keyPressEvent( QKeyEvent* event );
To copy to clipboard, switch view to plain text mode 

Which is defined as:

Qt Code:
  1. void SelectionDialog::keyPressEvent( QKeyEvent* event )
  2. {
  3. switch( event->key() )
  4. {
  5. case Qt::Key_Up:
  6. {
  7. upClicked();
  8. break;
  9. }
  10. case Qt::Key_Down:
  11. {
  12. downClicked();
  13. break;
  14. }
  15. default:
  16. {
  17. QDialog::keyPressEvent( event );
  18. break;
  19. }
  20. };
  21. }
To copy to clipboard, switch view to plain text mode 

In the constructor of my class, I do this

Qt Code:
  1. setFocusPolicy( Qt::StrongFocus );
  2. setFocus( Qt::PopupFocusReason );
  3. setEnabled( true );
To copy to clipboard, switch view to plain text mode 

Yet when this dialog box launches in the program, no amount of key presses gets me into this function.
What am I missing or doing wrong?