QWizard: avoid to go next when pressing enter [Qt4.5]
Hi all,
I'm creating a simple wizard.
The first page has a combo box. When I write something in the combobox and them commit the new text pressing the enter or return key, the combobox text is commited but the wizard passes to the next page.
Is there a way to disable this behavior?
I do not want to pass to the next page when the user commits the combobox text.
Thanks in advance for your help!
Re: QWizard: avoid to go next when pressing enter [Qt4.5]
Re-implement the virtual function keyPressEvent (QKeyEvent * event) of your wizard page. And seize the event of Qt::Key_Enter and Qt::Key_Backspace, then cal event->accept() without doing anything with these events. However, if wanna submit something, do it after catching these events and before calling event->accept();
Re: QWizard: avoid to go next when pressing enter [Qt4.5]
Thanks Freezeblue for your solution, it is working very well!