diff --git a/mainwindow.cpp b/mainwindow.cpp index da5eacc..5eeefe6 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -131,6 +131,7 @@ void MainWindow::loadStep(Step s) { ui->stepTitle->setText(s.getTitle()); ui->LatitudeSpin->setValue(s.getLatitude()); ui->longitudeSpin->setValue(s.getLongitude()); + ui->responseSpin->setValue(s.getResponse()); for(int i = 0; i < s.getTexte().length(); i++) { QString q = s.getPersonnage().at(i) + ": " + s.getTexte().at(i); @@ -276,9 +277,8 @@ void MainWindow::on_validateBtn_clicked() currentPath->setDifficulty(ui->diffSpin->value()); currentPath->setDuration(ui->durationSpin->value()); - Step currentStep = currentPath->getStep().at(ui->stepNumber->value()-1); + currentPath->getStep()[ui->stepNumber->value()-1].setTitle(ui->stepTitle->text()); + currentPath->getStep()[ui->stepNumber->value()-1].setResponse(ui->responseSpin->value()); - currentStep.setTitle(ui->stepTitle->text()); - currentStep.setResponse(ui->responseSpin->value()); } diff --git a/path.cpp b/path.cpp index 75f4687..d4ed62b 100644 --- a/path.cpp +++ b/path.cpp @@ -45,7 +45,7 @@ QString Path::getImage() const return image; } -QList Path::getStep() const +QList& Path::getStep() { return step; } diff --git a/path.h b/path.h index 919a89a..fef7334 100644 --- a/path.h +++ b/path.h @@ -28,7 +28,7 @@ public: float getDuration() const; float getLength() const; QString getImage() const; - QList getStep() const; + QList& getStep(); void setCity(const QString &newCity); void setDepartement(int newDepartement); void setName(const QString &newName);