janus
11th September 2008, 17:40
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 ...
BasicDataDialog::BasicDataDialog(QWidget *parent)
: QDialog(parent)
{
ui.setupUi(this);
ui.buttonBox->button(QDialogButtonBox::Ok)->setDefault(false);
ui.buttonBox->button(QDialogButtonBox::Cancel)->setDefault(false);
ui.buttonBox->button(QDialogButtonBox::Ok)->setAutoDefault(false);
ui.buttonBox->button(QDialogButtonBox::Cancel)->setAutoDefault(false);
.. but it did not work. :confused:
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 ...
BasicDataDialog::BasicDataDialog(QWidget *parent)
: QDialog(parent)
{
ui.setupUi(this);
ui.buttonBox->button(QDialogButtonBox::Ok)->setDefault(false);
ui.buttonBox->button(QDialogButtonBox::Cancel)->setDefault(false);
ui.buttonBox->button(QDialogButtonBox::Ok)->setAutoDefault(false);
ui.buttonBox->button(QDialogButtonBox::Cancel)->setAutoDefault(false);
.. but it did not work. :confused: