I try to jump with tab key between a QLineEdit and QPushButton but when I hit the key, the edit stays focused. This is the relevant code:

Qt Code:
  1. QWidget *widget = new QWidget(this);
  2. QVBoxLayout *vbox = new QVBoxLayout();
  3. widget->setLayout(vbox);
  4. QLineEdit *line = new QLineEdit();
  5. QPushButton *button = new QPushButton("click");
  6. vbox->addWidget(line);
  7. vbox->addWidget(button);
  8. setTabOrder(line, button);
  9. setTabOrder(button, line);
  10. setCentralWidget(widget);
To copy to clipboard, switch view to plain text mode 

Please, does anyone know what I'm doing wrong?