#include "newsequenz.h" #include "ui_newsequenz.h" #include #include NewSequenz::NewSequenz( int max, QWidget *parent) : QDialog(parent), ui(new Ui::NewSequenz), offset( 0 ), limit( 0 ) { ui->setupUi(this); ui->label->setText( "Es wurden " + QString::number( max ) + " Bilder gefunden." ); ui->min->setValidator( new QIntValidator(1, max, this) ); ui->max->setValidator( new QIntValidator(1, max, this) ); ui->min->setText( "1" ); ui->max->setText( QString::number( max ) ); } NewSequenz::~NewSequenz() { delete ui; } // Gibt das Offset zurück, ab dem die Bilder in den neuen Datensatz übertragen werden sollen int NewSequenz::getOffset() const { return offset; } // Gibt die Anzahl der Bilder zurück, die in den neuen Datensatz übertragen werden sollen int NewSequenz::getLimit() const { return limit; } // Schließt das Dialogfenster void NewSequenz::on_ok_clicked() { if( !ui->min->text().length() || !ui->max->text().length() ) return; int offset = ui->min->text().toInt() - 1; int limit = ui->max->text().toInt() - offset; if( limit > 0 && offset >= 0 ) { this->offset = offset; this->limit = limit; this->close(); } } // Schließt das Dialogfenster ohne angabe von Limit und Offset void NewSequenz::on_abbrechen_clicked() { this->close(); }