Display step title

This commit is contained in:
T'JAMPENS QUENTIN p2406187 2025-06-19 23:14:25 +02:00
parent 33970b36a7
commit ce6614e29d
2 changed files with 7 additions and 2 deletions

View File

@ -1,6 +1,7 @@
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "path.h"
#include "step.h"
#include "Undo.h"
#include <QFileDialog>
#include <QMessageBox>
@ -84,6 +85,7 @@ void MainWindow::loadPath()
file.close();
Path* p = new Path(&file);
QList<Step> 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()

View File

@ -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));
}
}