AddTestCasesWizard::AddTestCasesWizard(QWidget *parent) :
    QWizard(parent),
    ui(new Ui::AddTestCasesWizard)
{
    ui->setupUi(this);
    
    ui->fullScore->setValidator(new QIntValidator(1, Settings::upperBoundForFullScore(), this));
    ui->timeLimit->setValidator(new QIntValidator(1, Settings::upperBoundForTimeLimit(), this));
    ui->memoryLimit->setValidator(new QIntValidator(1, Settings::upperBoundForMemoryLimit(), this));
    
    connect(ui->fullScore, SIGNAL(textChanged(QString)),
            this, SLOT(fullScoreChanged(QString)));
    connect(ui->timeLimit, SIGNAL(textChanged(QString)),
            this, SLOT(timeLimitChanged(QString)));
    connect(ui->memoryLimit, SIGNAL(textChanged(QString)),
            this, SLOT(memoryLimitChanged(QString)));
    
    QHeaderView *header = ui->argumentList->horizontalHeader();
    for (int i = 0; i < 3; i ++) {
        header->resizeSection(i, header->sectionSizeHint(i));
    }
    
    connect(ui->inputFilesPattern, SIGNAL(textChanged(QString)),
            this, SLOT(inputFilesPatternChanged(QString)));
    connect(ui->outputFilesPattern, SIGNAL(textChanged(QString)),
            this, SLOT(outputFilesPatternChanged(QString)));
    connect(ui->addArgumentButton, SIGNAL(clicked()),
            this, SLOT(addArgument()));
    connect(ui->deleteArgumentButton, SIGNAL(clicked()),
            this, SLOT(deleteArgument()));
}
Exemplo n.º 2
0
AddTaskDialog::AddTaskDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::AddTaskDialog)
{
    ui->setupUi(this);

    ui->fullScore->setValidator(new QIntValidator(1, Settings::upperBoundForFullScore() * 100, this));
    ui->timeLimit->setValidator(new QIntValidator(1, Settings::upperBoundForTimeLimit(), this));
    ui->memoryLimit->setValidator(new QIntValidator(1, Settings::upperBoundForMemoryLimit(), this));

    connect(ui->taskBox, SIGNAL(currentIndexChanged(int)),
            this, SLOT(taskBoxIndexChanged()));
    connect(ui->fullScore, SIGNAL(textChanged(QString)),
            this, SLOT(fullScoreChanged()));
    connect(ui->timeLimit, SIGNAL(textChanged(QString)),
            this, SLOT(timeLimitChanged()));
    connect(ui->memoryLimit, SIGNAL(textChanged(QString)),
            this, SLOT(memoryLimitChanged()));
}