Hi,

I have a Dialog with a QDialogButtonBox and would like to remove the default button behavior i.e. when I press 'enter' the Dialog is closed. I tried this ...

Qt Code:
  1. BasicDataDialog::BasicDataDialog(QWidget *parent)
  2. : QDialog(parent)
  3. {
  4. ui.setupUi(this);
  5. ui.buttonBox->button(QDialogButtonBox::Ok)->setDefault(false);
  6. ui.buttonBox->button(QDialogButtonBox::Cancel)->setDefault(false);
  7. ui.buttonBox->button(QDialogButtonBox::Ok)->setAutoDefault(false);
  8. ui.buttonBox->button(QDialogButtonBox::Cancel)->setAutoDefault(false);
To copy to clipboard, switch view to plain text mode 

.. but it did not work.