Display step title
This commit is contained in:
parent
33970b36a7
commit
ce6614e29d
@ -1,6 +1,7 @@
|
|||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "ui_mainwindow.h"
|
#include "ui_mainwindow.h"
|
||||||
#include "path.h"
|
#include "path.h"
|
||||||
|
#include "step.h"
|
||||||
#include "Undo.h"
|
#include "Undo.h"
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
@ -84,6 +85,7 @@ void MainWindow::loadPath()
|
|||||||
|
|
||||||
file.close();
|
file.close();
|
||||||
Path* p = new Path(&file);
|
Path* p = new Path(&file);
|
||||||
|
QList<Step> steps = p->getStep();
|
||||||
currentPath = p;
|
currentPath = p;
|
||||||
path.append(p);
|
path.append(p);
|
||||||
|
|
||||||
@ -93,8 +95,11 @@ void MainWindow::loadPath()
|
|||||||
ui->lengthSpin->setValue(p->getLength());
|
ui->lengthSpin->setValue(p->getLength());
|
||||||
ui->durationSpin->setValue(p->getDuration());
|
ui->durationSpin->setValue(p->getDuration());
|
||||||
ui->imagePath->setText(p->getImage());
|
ui->imagePath->setText(p->getImage());
|
||||||
|
|
||||||
loadImage(p->getImage());
|
loadImage(p->getImage());
|
||||||
|
|
||||||
|
if(!steps.isEmpty()) {
|
||||||
|
ui->stepTitle->setText(p->getStep().first().getTitle());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::addNewPath()
|
void MainWindow::addNewPath()
|
||||||
|
|||||||
2
path.cpp
2
path.cpp
@ -75,7 +75,7 @@ Path::Path(QFile *file){
|
|||||||
QJsonArray stepsArray = json["steps"].toArray();
|
QJsonArray stepsArray = json["steps"].toArray();
|
||||||
for (const QJsonValue &stepValue : stepsArray) {
|
for (const QJsonValue &stepValue : stepsArray) {
|
||||||
QJsonObject stepObj = stepValue.toObject();
|
QJsonObject stepObj = stepValue.toObject();
|
||||||
//step.append(Step(stepObj));
|
step.append(Step(stepObj));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user