Files
DEC/DEC_GUI/Kolch_Shind/createrangedialog.cpp
2024-10-03 18:43:04 +07:00

45 lines
1.1 KiB
C++

#include "createrangedialog.h"
#include "limits.h"
#include <QPushButton>
#include <QLabel>
#include <QHBoxLayout>
#include <QGridLayout>
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();
}