From ce6614e29de3ac9ac53606129ab4e9bcee393c50 Mon Sep 17 00:00:00 2001 From: T'JAMPENS QUENTIN p2406187 Date: Thu, 19 Jun 2025 23:14:25 +0200 Subject: [PATCH] Display step title --- mainwindow.cpp | 7 ++++++- path.cpp | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index b37664a..340d269 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -1,6 +1,7 @@ #include "mainwindow.h" #include "ui_mainwindow.h" #include "path.h" +#include "step.h" #include "Undo.h" #include #include @@ -84,6 +85,7 @@ void MainWindow::loadPath() file.close(); Path* p = new Path(&file); + QList steps = p->getStep(); currentPath = p; path.append(p); @@ -93,8 +95,11 @@ void MainWindow::loadPath() ui->lengthSpin->setValue(p->getLength()); ui->durationSpin->setValue(p->getDuration()); ui->imagePath->setText(p->getImage()); - loadImage(p->getImage()); + + if(!steps.isEmpty()) { + ui->stepTitle->setText(p->getStep().first().getTitle()); + } } void MainWindow::addNewPath() diff --git a/path.cpp b/path.cpp index 7a421f7..26a2558 100644 --- a/path.cpp +++ b/path.cpp @@ -75,7 +75,7 @@ Path::Path(QFile *file){ QJsonArray stepsArray = json["steps"].toArray(); for (const QJsonValue &stepValue : stepsArray) { QJsonObject stepObj = stepValue.toObject(); - //step.append(Step(stepObj)); + step.append(Step(stepObj)); } }