Hi,
I need to change Tab key behavior for a QTextEdit so that when pressed the focus is passed to the next widget of the parent dialog (in tab order). So I have reimplemented void QWidget::keyPressEvent( QKeyEvent * event ) of my custom QTextEdit this way:

Qt Code:
  1. void CustomTextEdit::keyPressEvent(QKeyEvent *event)
  2. {
  3. switch (event->key()) {
  4. case Qt::Key_Tab:
  5. emit focusnextchild();
  6. break;
  7. default:
  8. QWidget::keyPressEvent(event);
  9. }
  10. }
To copy to clipboard, switch view to plain text mode 

but now only the Tab key works (and the next widget is focused); pressing any other key (for inserting text in the textedit, for example) does nothing.

Where am I wrong?