EditPreferences::EditPreferences(QWidget* parent, Qt::WindowFlags fl) : QDialog(parent, fl) { setupUi(this); // signals and slots connections connect(_btnCancel, SIGNAL(clicked()), this, SLOT(reject())); connect(_btnOk, SIGNAL(clicked()), this, SLOT(accept())); connect(_cbGridSymetrical, SIGNAL(toggled(bool)), _lblGridSizeY, SLOT(setDisabled(bool))); connect(_cbGridSymetrical, SIGNAL(toggled(bool)), _leGridSizeY, SLOT(setDisabled(bool))); connect(_btnChangeFont, SIGNAL(clicked()), this, SLOT(changeDefaultFont())); connect(_cbLanguage, SIGNAL(currentIndexChanged(const QString &)), this, SLOT(selLanguage(const QString &))); // install validator on _leGridSizeX and _leGridSizeY QDoubleValidator * dblval = new QDoubleValidator(0.01, 1000, 2, this); _leGridSizeX->setValidator(dblval); _leGridSizeY->setValidator(dblval); _cbLanguage->addItems(OpenRPT::languages.languageTitlesList()); for (int i=0; i<_cbLanguage->count(); i++) { if(_cbLanguage->itemText(i)==OpenRPT::languages.selectedTitle()) { _cbLanguage->setCurrentIndex(i); break; } } }
/* * Constructs a EditPreferences as a child of 'parent', with the * name 'name' and widget flags set to 'f'. * * The dialog will by default be modeless, unless you set 'modal' to * true to construct a modal dialog. */ EditPreferences::EditPreferences(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : QDialog(parent, name, modal, fl) { setupUi(this); // signals and slots connections connect(_btnCancel, SIGNAL(clicked()), this, SLOT(reject())); connect(_btnOk, SIGNAL(clicked()), this, SLOT(accept())); connect(_cbGridSymetrical, SIGNAL(toggled(bool)), _lblGridSizeY, SLOT(setDisabled(bool))); connect(_cbGridSymetrical, SIGNAL(toggled(bool)), _leGridSizeY, SLOT(setDisabled(bool))); connect(_btnChangeFont, SIGNAL(clicked()), this, SLOT(changeDefaultFont())); init(); }