PDA

View Full Version : setTabOrder for button



ecir.hana
8th March 2013, 16:22
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:


QWidget *widget = new QWidget(this);
QVBoxLayout *vbox = new QVBoxLayout();
widget->setLayout(vbox);
QLineEdit *line = new QLineEdit();
QPushButton *button = new QPushButton("click");
vbox->addWidget(line);
vbox->addWidget(button);
setTabOrder(line, button);
setTabOrder(button, line);
setCentralWidget(widget);

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

Lesiok
8th March 2013, 16:41
Remove line no 9.

ecir.hana
8th March 2013, 16:48
Does not help..? I'm on MacOS, using Qt 5.0.1.