fix of valider button

This commit is contained in:
Giovanni JOSSERAND 2025-06-20 16:47:19 +02:00
parent c6be9f6c17
commit be6c35faa8
2 changed files with 4 additions and 3 deletions

View File

@ -22,7 +22,7 @@ MainWindow::MainWindow(QWidget *parent)
, Clipboard(QGuiApplication::clipboard())
{
ui->setupUi(this);
//currentPath = new Path();
currentPath = new Path();
connect(ui->titleEdit, &QLineEdit::editingFinished, this, [this]() {
static QString previousText;
@ -53,6 +53,7 @@ MainWindow::MainWindow(QWidget *parent)
connect(ui->actionEditUndo, &QAction::triggered, undoStack, &QUndoStack::undo);
connect(ui->actionEditRedo, &QAction::triggered, undoStack, &QUndoStack::redo);
currentPath->getStep().append(Step());
}
MainWindow::~MainWindow()
@ -339,9 +340,7 @@ void MainWindow::on_validateBtn_clicked()
currentPath->setLength(ui->lengthSpin->value());
currentPath->setDifficulty(ui->diffSpin->value());
currentPath->setDuration(ui->durationSpin->value());
currentPath->getStep()[ui->stepNumber->value()-1].setTitle(ui->stepTitle->text());
currentPath->getStep()[ui->stepNumber->value()-1].setResponse(ui->responseSpin->value());
}

View File

@ -85,6 +85,8 @@ void Path::setImage(const QString &newImage)
image = newImage;
}
Path::Path(){}
Path::Path(QFile *file){
if (!file->open(QIODevice::ReadOnly)) {
qWarning() << "Could not open file:" << file->errorString();