QPushButton, QTabOrder and return key
Hello,
I have created two buttons:
Code:
layout->addWidget(cancelButton, 2, 0);
layout->addWidget(submitButton, 2, 1);
and connected them like this
Code:
connect(cancelButton, SIGNAL(clicked()), this, SLOT(cancel()));
connect(submitButton, SIGNAL(clicked()), this, SLOT(checkLogin()));
then, I specified some tabordering
Code:
setTabOrder(usernameLine, passwordLine);
setTabOrder(passwordLine, submitButton);
setTabOrder(submitButton, cancelButton);
once the password is entered and I press tab, the submitButton is highlighted but pressing the return key on my mac does not trigger anything. If I click the button with the mouse, it works fine. I am using Qt 4.2.0-rc1.
Thanks for any help
Re: QPushButton, QTabOrder and return key
AFAIR return key activates the default button, while space activates the button with focus.
Re: QPushButton, QTabOrder and return key
I think you should specify the submit button as "autodefault" or "default".