From 9b02342369418f86f5c9a5e6aea68eb3c9e7d936 Mon Sep 17 00:00:00 2001 From: iutbgdin Date: Wed, 18 Jun 2025 14:34:53 +0200 Subject: [PATCH 1/2] initialise path.h --- path.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 path.h diff --git a/path.h b/path.h new file mode 100644 index 0000000..52ec154 --- /dev/null +++ b/path.h @@ -0,0 +1,23 @@ +#ifndef PATH_H +#define PATH_H + +#include + +class Path +{ +private: + QString city; + int departement; + QString name; + unsigned int difficulty; + float duration; + float length; + QString image; + QList step; +public: + Path(); + Path(QFile *file); + void addStep(); +}; + +#endif // PATH_H From 7ce7ca9df5b5d70d6023adb4fd7a97370ce23d0d Mon Sep 17 00:00:00 2001 From: iutbgdin Date: Wed, 18 Jun 2025 15:09:29 +0200 Subject: [PATCH 2/2] First step for copy constructor --- main.cpp | 2 ++ path.cpp | 13 +++++++++++++ sae201.pro | 6 ++++-- 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 path.cpp diff --git a/main.cpp b/main.cpp index fd3e533..33dea00 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,7 @@ #include "mainwindow.h" +#include "path.h" + #include int main(int argc, char *argv[]) diff --git a/path.cpp b/path.cpp new file mode 100644 index 0000000..ab0fdfb --- /dev/null +++ b/path.cpp @@ -0,0 +1,13 @@ +#include "path.h" + + +Path::Path(QFile *file){ + QTextStream in(&file); + QString text = in.readAll(); + ui->textEdit->setText(text); + file.close(); +} +void Path::addStep(){ + +} + diff --git a/sae201.pro b/sae201.pro index b915c09..027fe54 100644 --- a/sae201.pro +++ b/sae201.pro @@ -10,10 +10,12 @@ CONFIG += c++17 SOURCES += \ main.cpp \ - mainwindow.cpp + mainwindow.cpp \ + path.cpp HEADERS += \ - mainwindow.h + mainwindow.h \ + path.h FORMS += \ mainwindow.ui