30 lines
634 B
C++
30 lines
634 B
C++
#include "gototimedialog.h"
|
|
#include "ui_gototimedialog.h"
|
|
#include <QMessageBox>
|
|
|
|
GoToTimeDialog::GoToTimeDialog(double* goToSecond,QWidget *parent) :
|
|
QDialog(parent),
|
|
goToSecond(goToSecond),
|
|
ui(new Ui::GoToTimeDialog)
|
|
{
|
|
ui->setupUi(this);
|
|
}
|
|
|
|
GoToTimeDialog::~GoToTimeDialog()
|
|
{
|
|
delete ui;
|
|
}
|
|
|
|
void GoToTimeDialog::on_pushButton_clicked()
|
|
{
|
|
QLocale c(QLocale::C);
|
|
bool validNumber;
|
|
*goToSecond = c.toDouble(ui->timeEdit->text(),&validNumber);
|
|
if(validNumber)
|
|
accept();
|
|
else
|
|
{
|
|
QMessageBox::warning(this,"Invalid number","Please enter a valid floating point number");
|
|
}
|
|
}
|