ConfigWizardWindow::ConfigWizardWindow(QWidget *parent) : QWizard(parent) { kdebugf(); setWindowRole("kadu-wizard"); setAttribute(Qt::WA_DeleteOnClose); setWindowTitle(tr("Kadu Wizard")); #ifdef Q_OS_MAC /* MacOSX has it's own QWizard style which requires much more space * than the other ones so we're forcing the ClassicStyle to unify * the window sizes and look. Mac users will love us for that. */ setWizardStyle(QWizard::ClassicStyle); #else #ifdef Q_OS_WIN // NOTE: Workaround for bug #1912. // TODO: Remove this as soon as QTBUG-10478 is fixed in // a release we bundle in the Windows build. setWizardStyle(QWizard::ModernStyle); #endif setMinimumSize(500, 500); #endif setPage(ProfilePage, new ConfigWizardProfilePage(this)); setPage(ChooseNetworkPage, new ConfigWizardChooseNetworkPage(this)); setPage(SetUpAccountPage, new ConfigWizardSetUpAccountPage(this)); setPage(CompletedPage, new ConfigWizardCompletedPage(this)); connect(this, SIGNAL(accepted()), this, SLOT(acceptedSlot())); connect(this, SIGNAL(rejected()), this, SLOT(rejectedSlot())); kdebugf2(); }
DialogWindow::DialogWindow(QWidget * parent) : QDialog(parent) { mgridlayout = new QGridLayout(this); mlabel = new QLabel("-"); mcombobox = new QComboBox(); // test-implm: add std buttons to the QDialog using a QDialogButtonBox mdialogbtnbox = new QDialogButtonBox(Qt::Horizontal); mdialogbtnbox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok); // connect the signals emitted form the QDialogButtonBox to the appropriate slots ( here, 'accepted()' & 'rejected()', as we use standard buttons and not QPushButtons inside the QDialogButtonBox ) connect( mdialogbtnbox, SIGNAL(accepted()), this, SLOT(acceptedSlot()) ); connect( mdialogbtnbox, SIGNAL(rejected()), this, SLOT(rejectedSlot()) ); // fill the commbo box with stuff mcombobox->addItem("AAA"); mcombobox->addItem("CCC"); mcombobox->addItem("GGG"); mcombobox->addItem("TTT"); // connect the 'activated' signal ( aka when the combobox selection changes ) to the appropriate slot QObject::connect( mcombobox, SIGNAL(activated(int)), this, SLOT(mSlot(int)) ); // add widgets to the dialog window mgridlayout->addWidget(mcombobox, 0, 0, Qt::AlignLeft); mgridlayout->addWidget(mlabel, 1, 0, Qt::AlignLeft); mgridlayout->addWidget(mdialogbtnbox, 2, 0, Qt::AlignLeft); setMinimumSize(250, 150); // specify a minimum size for the dialog window //resize(50, 200); //setFixedSize(350, 100); }
AppearanceDialog::AppearanceDialog(QWidget* parent) : QDialog(parent), ui(new Ui::AppearanceDialog) { ui->setupUi(this); //set window flags setModal(true); setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint | Qt::MSWindowsFixedSizeDialogHint); //Colors colorMap = &Config()->Colors; colorBackupMap = *colorMap; ui->groupColor->setEnabled(false); ui->groupBackgroundColor->setEnabled(false); colorInfoListInit(); //Fonts fontMap = &Config()->Fonts; fontBackupMap = *fontMap; fontInit(); connect(this, SIGNAL(rejected()), this, SLOT(rejectedSlot())); }