Active Topics

 


Reply
Thread Tools
Posts: 123 | Thanked: 21 times | Joined on Sep 2009
#1
Hi,

How can I implement the typical settings dialog from Qt?

I'm currently trying the simpler version of the example in the documentation :

Code:
buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok
                                      | QDialogButtonBox::Cancel);

     connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
     connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
I've noticed the comments on QDialogButtonBox here but it seems to occupy the whole screen, which might indicate I've not set the Cancel button, but that isn't the case :

Code:
  m_settingsDialog = new QDialogButtonBox(
      QDialogButtonBox::Save | QDialogButtonBox::Cancel
      );

  m_settingsDialog->show();

  connect(m_settingsDialog, SIGNAL(accepted()), this, SLOT(acceptSettings()));
  connect(m_settingsDialog, SIGNAL(rejected()), this, SLOT(acceptSettings()));
NB. At the moment, acceptSettings() doesn't do anything apart from hide and delete the dialog.

So, am I using the correct dialogue for a typical settings panel? If so, what am I doing wrong?

Thanks,

Max.
PS Using Qt4.6.2 on PR1.2
 
Reply


 
Forum Jump


All times are GMT. The time now is 22:35.