#include "createrangedialog.h" #include "limits.h" #include #include #include #include CreateRangeDialog::CreateRangeDialog(QWidget *parent, int flag) : QDialog(parent) { if (flag == 1) //iterate window { QGridLayout *layout = new QGridLayout(this); layout->addWidget(new QLabel(tr("Add new iterations:")), 0, 0); iterations = new QLineEdit; layout->addWidget(iterations, 0, 1); QHBoxLayout *buttonLayout = new QHBoxLayout; layout->addLayout(buttonLayout, 1, 0, 1, 0); buttonLayout->addStretch(); QPushButton *cancelButton = new QPushButton(tr("Cancel")); connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject())); buttonLayout->addWidget(cancelButton); QPushButton *okButton = new QPushButton(tr("OK")); connect(okButton, SIGNAL(clicked()), this, SLOT(accept())); buttonLayout->addWidget(okButton); okButton->setDefault(true); } } QString CreateRangeDialog::iterField() { return iterations->text(); }