Merge branch 'dev' into 'feature/web'
# Conflicts: # data/parcours2.json # mainwindow.cpp # mainwindow.h # step.cpp # step.h
This commit is contained in:
commit
d3b84f32f4
21
Undo.h
Normal file
21
Undo.h
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
#ifndef UNDO_H
|
||||||
|
#define UNDO_H
|
||||||
|
|
||||||
|
#include <QUndoCommand>
|
||||||
|
#include <QLineEdit>
|
||||||
|
|
||||||
|
class LineEditCommand : public QUndoCommand {
|
||||||
|
public:
|
||||||
|
LineEditCommand(QLineEdit* edit, const QString& oldText, const QString& newText)
|
||||||
|
: m_edit(edit), m_oldText(oldText), m_newText(newText) {}
|
||||||
|
|
||||||
|
void undo() override { m_edit->setText(m_oldText); }
|
||||||
|
void redo() override { m_edit->setText(m_newText); }
|
||||||
|
|
||||||
|
private:
|
||||||
|
QLineEdit* m_edit;
|
||||||
|
QString m_oldText;
|
||||||
|
QString m_newText;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // UNDO_H
|
||||||
0
data/images/d.json
Normal file
0
data/images/d.json
Normal file
@ -1,44 +1,75 @@
|
|||||||
{
|
{
|
||||||
"name": "parcours2",
|
"city": "Bourg en Bresse",
|
||||||
"city": "Paris",
|
"departement": "1",
|
||||||
"departement": 1,
|
"difficulty": 3,
|
||||||
"difficulty": 2,
|
"duration": 3.8,
|
||||||
"duration": 2.3,
|
"image": "data/parcours1.png",
|
||||||
"length": 17.3,
|
"length": 24.6,
|
||||||
"image": "../data/parcours1.png",
|
"name": "Chemin des",
|
||||||
"steps": [
|
"steps": [
|
||||||
{
|
{
|
||||||
"numero": 1,
|
"GPS": "N 46 12.321 E 5 13.245",
|
||||||
"title": "Première étape",
|
"dialogue": [
|
||||||
"GPS": "N 45 37.199 W 1 2.009",
|
{
|
||||||
"reponse": -1,
|
"personnage": "Clémentine",
|
||||||
"dialogue": [
|
"texte": "Bienvenue à tous, voici le centre historique !"
|
||||||
{
|
},
|
||||||
"personnage": "Quentin",
|
{
|
||||||
"texte": "ligne de dialogue 1 HJDDDZJJJJJJJJJJJJJJJJJJJDBJBDJZBZJDBJ"
|
"personnage": "Léo",
|
||||||
},
|
"texte": "Regardez cette magnifique horloge, elle date du XIXe siècle !"
|
||||||
{
|
|
||||||
"personnage": "Malo",
|
|
||||||
"texte": "ligne de dialogue 2BDJJHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHBDHDBHBZHVZDHVHVHEDHJVHVDHEDJD"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"numero": 2,
|
|
||||||
"title": "Deuxième étape",
|
|
||||||
"GPS": "S 45 37.199 E 1 2.009",
|
|
||||||
"reponse": 4156,
|
|
||||||
"dialogue": [
|
|
||||||
{
|
|
||||||
"personnage": "Antoine",
|
|
||||||
"texte": "ligne de dialogue 1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"personnage": "Giovanni",
|
|
||||||
"texte": "ligne de dialogue 2"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"numero": 1,
|
||||||
|
"reponse": 0,
|
||||||
|
"title": "Départ au centre-ville"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"GPS": "N 46 12.500 E 5 13.800",
|
||||||
|
"dialogue": [
|
||||||
|
{
|
||||||
|
"personnage": "Aurélie",
|
||||||
|
"texte": "Ici, on trouve les meilleurs fromages de la région !"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"personnage": "Sami",
|
||||||
|
"texte": "Combien de colonnes vois-tu à l'entrée ?"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"numero": 2,
|
||||||
|
"reponse": 6,
|
||||||
|
"title": "Marché couvert"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"GPS": "N 46 12.900 E 5 13.900",
|
||||||
|
"dialogue": [
|
||||||
|
{
|
||||||
|
"personnage": "Juliette",
|
||||||
|
"texte": "La Reyssouze apporte de la fraîcheur en été."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"personnage": "Marc",
|
||||||
|
"texte": "Regarde cette inscription ancienne sur la pierre, tu arrives à la lire ?"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"numero": 3,
|
||||||
|
"reponse": 0,
|
||||||
|
"title": "Au bord de la Reyssouze"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"GPS": "N 46 13.024 E 5 14.160",
|
||||||
|
"dialogue": [
|
||||||
|
{
|
||||||
|
"personnage": "Claire",
|
||||||
|
"texte": "Voilà l'abbaye ! Admire l'architecture."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"personnage": "Nathalie",
|
||||||
|
"texte": "C'est ici la dernière étape. Observez bien la date !"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"numero": 4,
|
||||||
|
"reponse": 1655,
|
||||||
|
"title": "Arrivée à l'abbaye"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
263
mainwindow.cpp
263
mainwindow.cpp
@ -1,19 +1,59 @@
|
|||||||
#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 <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
#include <QLineEdit>
|
||||||
|
#include <QTimer>
|
||||||
|
#include <QFile>
|
||||||
|
#include <QJsonDocument>
|
||||||
|
#include <QJsonObject>
|
||||||
|
#include <QJsonArray>
|
||||||
|
|
||||||
int MainWindow::indexPath = 0;
|
int MainWindow::indexPath = 0;
|
||||||
|
|
||||||
MainWindow::MainWindow(QWidget *parent)
|
MainWindow::MainWindow(QWidget *parent)
|
||||||
: QMainWindow(parent)
|
: QMainWindow(parent)
|
||||||
, ui(new Ui::MainWindow)
|
, ui(new Ui::MainWindow)
|
||||||
|
, undoStack(new QUndoStack(this))
|
||||||
|
, Clipboard(QGuiApplication::clipboard())
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
indexPath++;
|
indexPath++;
|
||||||
|
//currentPath = new Path();
|
||||||
|
|
||||||
|
connect(ui->titleEdit, &QLineEdit::editingFinished, this, [this]() {
|
||||||
|
static QString previousText;
|
||||||
|
QString currentText = ui->titleEdit->text();
|
||||||
|
if(previousText != currentText) {
|
||||||
|
undoStack->push(new LineEditCommand(ui->titleEdit, previousText, currentText));
|
||||||
|
previousText = currentText;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
connect(ui->locEdit, &QLineEdit::editingFinished, this, [this]() {
|
||||||
|
static QString previousText;
|
||||||
|
QString currentText = ui->locEdit->text();
|
||||||
|
if(previousText != currentText) {
|
||||||
|
undoStack->push(new LineEditCommand(ui->locEdit, previousText, currentText));
|
||||||
|
previousText = currentText;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
connect(ui->imagePath, &QLineEdit::editingFinished, this, [this]() {
|
||||||
|
static QString previousText;
|
||||||
|
QString currentText = ui->imagePath->text();
|
||||||
|
if(previousText != currentText) {
|
||||||
|
undoStack->push(new LineEditCommand(ui->imagePath, previousText, currentText));
|
||||||
|
previousText = currentText;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
connect(ui->actionEditUndo, &QAction::triggered, undoStack, &QUndoStack::undo);
|
||||||
|
connect(ui->actionEditRedo, &QAction::triggered, undoStack, &QUndoStack::redo);
|
||||||
}
|
}
|
||||||
|
|
||||||
MainWindow::~MainWindow()
|
MainWindow::~MainWindow()
|
||||||
@ -36,7 +76,7 @@ void MainWindow::onTextChanged()
|
|||||||
textChanged = true;
|
textChanged = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::loadPath()
|
void MainWindow::loadNewPath()
|
||||||
{
|
{
|
||||||
QString fileName = QFileDialog::getOpenFileName(this, "Open the file");
|
QString fileName = QFileDialog::getOpenFileName(this, "Open the file");
|
||||||
if(fileName.isEmpty()) return;
|
if(fileName.isEmpty()) return;
|
||||||
@ -50,6 +90,19 @@ void MainWindow::loadPath()
|
|||||||
Path* p = new Path(&file);
|
Path* p = new Path(&file);
|
||||||
currentPath = p;
|
currentPath = p;
|
||||||
path.append(p);
|
path.append(p);
|
||||||
|
loadPath(p);
|
||||||
|
currentFile = fileName;
|
||||||
|
|
||||||
|
int pathCount = path.length();
|
||||||
|
ui->pathNumber->setMaximum(pathCount);
|
||||||
|
ui->pathNumber->setSuffix("/" + QString::number(pathCount));
|
||||||
|
ui->pathNumber->setValue(path.indexOf(currentPath)+1);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::loadPath(Path* p) {
|
||||||
|
|
||||||
|
QList<Step> steps = p->getStep();
|
||||||
|
|
||||||
|
|
||||||
ui->titleEdit->setText(p->getName());
|
ui->titleEdit->setText(p->getName());
|
||||||
ui->locEdit->setText(p->getCity());
|
ui->locEdit->setText(p->getCity());
|
||||||
@ -57,8 +110,39 @@ 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());
|
||||||
|
ui->depSpin->setValue(p->getDepartement());
|
||||||
loadImage(p->getImage());
|
loadImage(p->getImage());
|
||||||
|
|
||||||
|
|
||||||
|
ui->dialogEdit->clear();
|
||||||
|
|
||||||
|
if(!steps.isEmpty()) {
|
||||||
|
Step firstStep = p->getStep().first();
|
||||||
|
ui->stepTitle->setText(firstStep.getTitle());
|
||||||
|
ui->LatitudeSpin->setValue(firstStep.getLatitude());
|
||||||
|
ui->longitudeSpin->setValue(firstStep.getLongitude());
|
||||||
|
|
||||||
|
for(int i = 0; i < firstStep.getTexte().length(); i++) {
|
||||||
|
QString q = firstStep.getPersonnage().at(i) + ": " + firstStep.getTexte().at(i);
|
||||||
|
ui->dialogEdit->appendPlainText(q);
|
||||||
|
}
|
||||||
|
|
||||||
|
ui->stepNumber->setValue(1);
|
||||||
|
ui->stepNumber->setSuffix("/" + QString::number(steps.length()));
|
||||||
|
ui->stepNumber->setMaximum(steps.length());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
|
ui->dialogEdit->appendPlainText(q);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::addNewPath()
|
void MainWindow::addNewPath()
|
||||||
@ -267,36 +351,35 @@ void MainWindow::exportHTMLMap(int index)
|
|||||||
|
|
||||||
|
|
||||||
void MainWindow::loadImage(QString fileName) {
|
void MainWindow::loadImage(QString fileName) {
|
||||||
|
|
||||||
QString ext[] = {"png", "jpeg", "jpg"};
|
QString ext[] = {"png", "jpeg", "jpg"};
|
||||||
|
|
||||||
QFile file(fileName);
|
QFile file(fileName);
|
||||||
if (!file.open(QIODevice::ReadOnly | QFile::Text)) {
|
if (!file.open(QIODevice::ReadOnly | QFile::Text)) {
|
||||||
QMessageBox::warning(this, "Warning", "Cannot open file: " +
|
QMessageBox::warning(this, "Warning", "Cannot open image: " +
|
||||||
file.errorString());
|
file.errorString());
|
||||||
return;
|
|
||||||
}
|
|
||||||
QString text = file.fileName();
|
|
||||||
|
|
||||||
bool acceptedExt = false;
|
}else{
|
||||||
for(QString e : ext) {
|
QString text = file.fileName();
|
||||||
if(text.endsWith(e)) acceptedExt = true;
|
bool acceptedExt = false;
|
||||||
|
for(QString e : ext) {
|
||||||
|
if(text.endsWith(e)) acceptedExt = true;
|
||||||
|
}
|
||||||
|
if(!acceptedExt) {
|
||||||
|
QMessageBox::warning(this, "Warning", "Format de fichier incorrect");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ui->imagePath->setText(text);
|
||||||
|
|
||||||
|
|
||||||
|
QPixmap px(fileName);
|
||||||
|
|
||||||
|
ui->imageLbl->setPixmap(px);
|
||||||
|
|
||||||
|
file.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!acceptedExt) {
|
|
||||||
QMessageBox::warning(this, "Warning", "Format de fichier incorrect");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ui->imagePath->setText(text);
|
|
||||||
|
|
||||||
|
|
||||||
QPixmap px(fileName);
|
|
||||||
|
|
||||||
ui->imageLbl->setPixmap(px);
|
|
||||||
|
|
||||||
file.close();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -310,7 +393,7 @@ void MainWindow::on_pushButton_clicked()
|
|||||||
|
|
||||||
void MainWindow::on_actionOpen_triggered()
|
void MainWindow::on_actionOpen_triggered()
|
||||||
{
|
{
|
||||||
this->loadPath();
|
this->loadNewPath();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::on_toolButton_clicked()
|
void MainWindow::on_toolButton_clicked()
|
||||||
@ -320,6 +403,7 @@ void MainWindow::on_toolButton_clicked()
|
|||||||
loadImage(fileName);
|
loadImage(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<<<<<<< mainwindow.cpp
|
||||||
int MainWindow::getIndexPath() const
|
int MainWindow::getIndexPath() const
|
||||||
{
|
{
|
||||||
return indexPath;
|
return indexPath;
|
||||||
@ -358,5 +442,132 @@ Path *MainWindow::getCurrentPath() const
|
|||||||
void MainWindow::setCurrentPath(Path *newCurrentPath)
|
void MainWindow::setCurrentPath(Path *newCurrentPath)
|
||||||
{
|
{
|
||||||
currentPath = newCurrentPath;
|
currentPath = newCurrentPath;
|
||||||
|
=======
|
||||||
|
|
||||||
|
void MainWindow::saveFile(){
|
||||||
|
QString fileName;
|
||||||
|
if (currentFile.isEmpty()) {
|
||||||
|
fileName = QFileDialog::getSaveFileName(this, "Save");
|
||||||
|
currentFile = fileName;
|
||||||
|
} else {
|
||||||
|
fileName = currentFile;
|
||||||
|
}
|
||||||
|
QFile file(fileName);
|
||||||
|
if (!file.open(QIODevice::WriteOnly | QFile::Text)) {
|
||||||
|
QMessageBox::warning(this, "Warning", "Cannot save file: " + file.errorString());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
setWindowTitle(fileName);
|
||||||
|
QJsonObject json;
|
||||||
|
json["name"] = ui->titleEdit->text();
|
||||||
|
json["city"] =ui->locEdit->text();
|
||||||
|
json["departement"] = ui->depSpin->text();
|
||||||
|
json["difficulty"] = ui->diffSpin->value();
|
||||||
|
json["duration"] = ui->durationSpin->value();
|
||||||
|
json["length"] = ui->lengthSpin->value();
|
||||||
|
json["image"] = ui->imagePath->text();
|
||||||
|
|
||||||
|
QJsonArray steps;
|
||||||
|
int cpt=0;
|
||||||
|
for(Step step: currentPath->getStep()){
|
||||||
|
cpt++;
|
||||||
|
QJsonObject stepObject;
|
||||||
|
stepObject["numero"] = cpt;
|
||||||
|
stepObject["title"] = step.getTitle();
|
||||||
|
stepObject["GPS"] = step.toGPSFormat();
|
||||||
|
stepObject["reponse"] = step.getResponse();
|
||||||
|
QJsonArray dialogues;
|
||||||
|
for(int i=0; i<step.getTexte().size(); i++){
|
||||||
|
QJsonObject dialogueObject;
|
||||||
|
dialogueObject["personnage"] = step.getPersonnage()[i];
|
||||||
|
dialogueObject["texte"] = step.getTexte()[i];
|
||||||
|
dialogues.append(dialogueObject);
|
||||||
|
}
|
||||||
|
stepObject["dialogue"] = dialogues;
|
||||||
|
steps.append(stepObject);
|
||||||
|
}
|
||||||
|
json["steps"] = steps;
|
||||||
|
QJsonDocument doc(json);
|
||||||
|
file.write(doc.toJson());
|
||||||
|
|
||||||
|
file.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::on_actionSave_triggered()
|
||||||
|
{
|
||||||
|
this->saveFile();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::on_actionopenFile_triggered()
|
||||||
|
{
|
||||||
|
this->loadNewPath();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::on_actionEditCopy_triggered()
|
||||||
|
{
|
||||||
|
QWidget *focused = QApplication::focusWidget();
|
||||||
|
QLineEdit* lineEdit = qobject_cast<QLineEdit*>(focused);
|
||||||
|
|
||||||
|
if(lineEdit) {
|
||||||
|
Clipboard->setText(lineEdit->selectedText());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void MainWindow::on_actionEditPaste_triggered()
|
||||||
|
{
|
||||||
|
QWidget *focused = QApplication::focusWidget();
|
||||||
|
QLineEdit* lineEdit = qobject_cast<QLineEdit*>(focused);
|
||||||
|
|
||||||
|
if(lineEdit) {
|
||||||
|
QString text = lineEdit->text();
|
||||||
|
int pos = lineEdit->cursorPosition();
|
||||||
|
text.insert(pos, Clipboard->text());
|
||||||
|
lineEdit->setText(text);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void MainWindow::on_actionEditCut_triggered()
|
||||||
|
{
|
||||||
|
QWidget *focused = QApplication::focusWidget();
|
||||||
|
QLineEdit* lineEdit = qobject_cast<QLineEdit*>(focused);
|
||||||
|
|
||||||
|
if(lineEdit) {
|
||||||
|
QString text = lineEdit->text();
|
||||||
|
QString selectedText = lineEdit->selectedText();
|
||||||
|
int pos = lineEdit->selectionStart();
|
||||||
|
text.remove(pos, selectedText.length());
|
||||||
|
Clipboard->setText(selectedText);
|
||||||
|
lineEdit->setText(text);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void MainWindow::on_pathNumber_valueChanged(int arg1)
|
||||||
|
{
|
||||||
|
this->loadPath(path.at(ui->pathNumber->value()-1));
|
||||||
|
currentPath = path.at(arg1-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void MainWindow::on_stepNumber_valueChanged(int arg1)
|
||||||
|
{
|
||||||
|
this->loadStep(currentPath->getStep().at(arg1-1));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void MainWindow::on_validateBtn_clicked()
|
||||||
|
{
|
||||||
|
currentPath->setName(ui->titleEdit->text());
|
||||||
|
currentPath->setCity(ui->locEdit->text());
|
||||||
|
currentPath->setImage(ui->imagePath->text());
|
||||||
|
currentPath->setLength(ui->lengthSpin->value());
|
||||||
|
currentPath->setDifficulty(ui->diffSpin->value());
|
||||||
|
currentPath->setDuration(ui->durationSpin->value());
|
||||||
|
|
||||||
|
currentPath->getStep()[ui->stepNumber->value()-1].setTitle(ui->stepTitle->text());
|
||||||
|
currentPath->getStep()[ui->stepNumber->value()-1].setResponse(ui->responseSpin->value());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
27
mainwindow.h
27
mainwindow.h
@ -2,7 +2,8 @@
|
|||||||
#define MAINWINDOW_H
|
#define MAINWINDOW_H
|
||||||
|
|
||||||
#include <QMainWindow>
|
#include <QMainWindow>
|
||||||
|
#include <QUndoStack>
|
||||||
|
#include <QClipboard>
|
||||||
#include "path.h"
|
#include "path.h"
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
@ -21,7 +22,9 @@ public:
|
|||||||
void updatePathView();
|
void updatePathView();
|
||||||
void updateStepView(size_t num);
|
void updateStepView(size_t num);
|
||||||
void onTextChanged();
|
void onTextChanged();
|
||||||
void loadPath();
|
void loadNewPath();
|
||||||
|
void loadPath(Path* p);
|
||||||
|
void loadStep(Step s);
|
||||||
void addNewPath();
|
void addNewPath();
|
||||||
void addNewStep();
|
void addNewStep();
|
||||||
void exportHTMLMap(int index);
|
void exportHTMLMap(int index);
|
||||||
@ -35,6 +38,8 @@ public:
|
|||||||
|
|
||||||
int getIndexPath() const;
|
int getIndexPath() const;
|
||||||
void setIndexPath(int newIndexPath);
|
void setIndexPath(int newIndexPath);
|
||||||
|
void exportHTMLMap();
|
||||||
|
void saveFile();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void on_pushButton_clicked();
|
void on_pushButton_clicked();
|
||||||
@ -43,6 +48,22 @@ private slots:
|
|||||||
|
|
||||||
void on_toolButton_clicked();
|
void on_toolButton_clicked();
|
||||||
|
|
||||||
|
void on_actionSave_triggered();
|
||||||
|
|
||||||
|
void on_actionopenFile_triggered();
|
||||||
|
|
||||||
|
void on_actionEditCopy_triggered();
|
||||||
|
|
||||||
|
void on_actionEditPaste_triggered();
|
||||||
|
|
||||||
|
void on_actionEditCut_triggered();
|
||||||
|
|
||||||
|
void on_pathNumber_valueChanged(int arg1);
|
||||||
|
|
||||||
|
void on_stepNumber_valueChanged(int arg1);
|
||||||
|
|
||||||
|
void on_validateBtn_clicked();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::MainWindow *ui;
|
Ui::MainWindow *ui;
|
||||||
QString currentFile;
|
QString currentFile;
|
||||||
@ -51,5 +72,7 @@ private:
|
|||||||
QList<Path*> path;
|
QList<Path*> path;
|
||||||
Path* currentPath;
|
Path* currentPath;
|
||||||
void loadImage(QString fileName);
|
void loadImage(QString fileName);
|
||||||
|
QUndoStack *undoStack;
|
||||||
|
QClipboard* Clipboard;
|
||||||
};
|
};
|
||||||
#endif // MAINWINDOW_H
|
#endif // MAINWINDOW_H
|
||||||
|
|||||||
670
mainwindow.ui
670
mainwindow.ui
@ -7,17 +7,41 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>800</width>
|
<width>800</width>
|
||||||
<height>626</height>
|
<height>868</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>MainWindow</string>
|
<string>MainWindow</string>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="centralwidget">
|
<widget class="QWidget" name="centralwidget">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>30</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>800</width>
|
<width>800</width>
|
||||||
<height>521</height>
|
<height>1000</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
@ -38,13 +62,16 @@
|
|||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Path information</string>
|
<string>Path information</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignTop</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QFrame" name="frame">
|
<widget class="QFrame" name="frame">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>16777215</width>
|
<width>16777215</width>
|
||||||
@ -52,217 +79,230 @@
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="frameShape">
|
<property name="frameShape">
|
||||||
<enum>QFrame::Shape::StyledPanel</enum>
|
<enum>QFrame::Shape::NoFrame</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="frameShadow">
|
<layout class="QHBoxLayout" name="horizontalLayout_13">
|
||||||
<enum>QFrame::Shadow::Raised</enum>
|
<item>
|
||||||
</property>
|
<widget class="QWidget" name="widget_8" native="true">
|
||||||
<widget class="QSpinBox" name="spinBox">
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
<property name="geometry">
|
<item>
|
||||||
<rect>
|
<widget class="QWidget" name="widget_7" native="true">
|
||||||
<x>10</x>
|
<layout class="QHBoxLayout" name="horizontalLayout_12">
|
||||||
<y>20</y>
|
<item>
|
||||||
<width>45</width>
|
<widget class="QSpinBox" name="pathNumber">
|
||||||
<height>27</height>
|
<property name="minimum">
|
||||||
</rect>
|
<number>1</number>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
<property name="value">
|
||||||
<widget class="QLineEdit" name="titleEdit">
|
<number>1</number>
|
||||||
<property name="geometry">
|
</property>
|
||||||
<rect>
|
</widget>
|
||||||
<x>60</x>
|
</item>
|
||||||
<y>20</y>
|
<item>
|
||||||
<width>391</width>
|
<widget class="QLineEdit" name="titleEdit"/>
|
||||||
<height>26</height>
|
</item>
|
||||||
</rect>
|
</layout>
|
||||||
</property>
|
</widget>
|
||||||
</widget>
|
</item>
|
||||||
<widget class="QWidget" name="widget" native="true">
|
<item>
|
||||||
<property name="geometry">
|
<widget class="QWidget" name="widget" native="true">
|
||||||
<rect>
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<x>10</x>
|
<property name="leftMargin">
|
||||||
<y>60</y>
|
<number>0</number>
|
||||||
<width>441</width>
|
|
||||||
<height>45</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
|
||||||
<property name="leftMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="rightMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label">
|
|
||||||
<property name="text">
|
|
||||||
<string>Localisation</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLineEdit" name="locEdit"/>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QSpinBox" name="spinBox_2"/>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<widget class="QLabel" name="imageLbl">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>470</x>
|
|
||||||
<y>20</y>
|
|
||||||
<width>281</width>
|
|
||||||
<height>191</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QWidget" name="widget_5" native="true">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>110</y>
|
|
||||||
<width>451</width>
|
|
||||||
<height>63</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
|
||||||
<property name="leftMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="rightMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<widget class="QWidget" name="widget_2" native="true">
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label_3">
|
|
||||||
<property name="text">
|
|
||||||
<string>Difficulty</string>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
<property name="rightMargin">
|
||||||
</item>
|
<number>0</number>
|
||||||
<item>
|
|
||||||
<widget class="QSpinBox" name="diffSpin">
|
|
||||||
<property name="suffix">
|
|
||||||
<string>/5</string>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="maximum">
|
<item>
|
||||||
<number>5</number>
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="text">
|
||||||
|
<string>Localisation</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="locEdit"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QSpinBox" name="depSpin"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QWidget" name="widget_5" native="true">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
<property name="rightMargin">
|
||||||
</item>
|
<number>0</number>
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QWidget" name="widget_3" native="true">
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label_4">
|
|
||||||
<property name="text">
|
|
||||||
<string>Duration</string>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
<item>
|
||||||
</item>
|
<widget class="QWidget" name="widget_2" native="true">
|
||||||
<item>
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
<widget class="QDoubleSpinBox" name="durationSpin">
|
<property name="topMargin">
|
||||||
<property name="suffix">
|
<number>0</number>
|
||||||
<string>h</string>
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_3">
|
||||||
|
<property name="text">
|
||||||
|
<string>Difficulty</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QSpinBox" name="diffSpin">
|
||||||
|
<property name="suffix">
|
||||||
|
<string>/5</string>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>5</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QWidget" name="widget_3" native="true">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_4">
|
||||||
|
<property name="text">
|
||||||
|
<string>Duration</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QDoubleSpinBox" name="durationSpin">
|
||||||
|
<property name="suffix">
|
||||||
|
<string>h</string>
|
||||||
|
</property>
|
||||||
|
<property name="decimals">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
<property name="singleStep">
|
||||||
|
<double>0.100000000000000</double>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QWidget" name="widget_4" native="true">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_5">
|
||||||
|
<property name="text">
|
||||||
|
<string>Length</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QDoubleSpinBox" name="lengthSpin">
|
||||||
|
<property name="suffix">
|
||||||
|
<string>Km</string>
|
||||||
|
</property>
|
||||||
|
<property name="decimals">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<double>500.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
<property name="singleStep">
|
||||||
|
<double>0.100000000000000</double>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QWidget" name="widget_6" native="true">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>9</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="decimals">
|
<property name="rightMargin">
|
||||||
<number>1</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="singleStep">
|
<item>
|
||||||
<double>0.100000000000000</double>
|
<widget class="QLabel" name="label_6">
|
||||||
</property>
|
<property name="text">
|
||||||
</widget>
|
<string>Image</string>
|
||||||
</item>
|
</property>
|
||||||
</layout>
|
</widget>
|
||||||
</widget>
|
</item>
|
||||||
</item>
|
<item>
|
||||||
<item>
|
<widget class="QLineEdit" name="imagePath"/>
|
||||||
<widget class="QWidget" name="widget_4" native="true">
|
</item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
<item>
|
||||||
<item>
|
<widget class="QToolButton" name="toolButton">
|
||||||
<widget class="QLabel" name="label_5">
|
<property name="text">
|
||||||
<property name="text">
|
<string>...</string>
|
||||||
<string>Length</string>
|
</property>
|
||||||
</property>
|
<property name="icon">
|
||||||
</widget>
|
<iconset resource="data.qrc">
|
||||||
</item>
|
<normaloff>:/data/images/data/images/add.png</normaloff>:/data/images/data/images/add.png</iconset>
|
||||||
<item>
|
</property>
|
||||||
<widget class="QDoubleSpinBox" name="lengthSpin">
|
</widget>
|
||||||
<property name="suffix">
|
</item>
|
||||||
<string>Km</string>
|
<item>
|
||||||
</property>
|
<widget class="QPushButton" name="pushButton">
|
||||||
<property name="decimals">
|
<property name="text">
|
||||||
<number>1</number>
|
<string>Select Image File</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximum">
|
</widget>
|
||||||
<double>500.000000000000000</double>
|
</item>
|
||||||
</property>
|
</layout>
|
||||||
<property name="singleStep">
|
</widget>
|
||||||
<double>0.100000000000000</double>
|
</item>
|
||||||
</property>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
<item>
|
||||||
</widget>
|
<widget class="QLabel" name="imageLbl">
|
||||||
</item>
|
<property name="minimumSize">
|
||||||
</layout>
|
<size>
|
||||||
</widget>
|
<width>300</width>
|
||||||
<widget class="QWidget" name="widget_6" native="true">
|
<height>0</height>
|
||||||
<property name="geometry">
|
</size>
|
||||||
<rect>
|
</property>
|
||||||
<x>0</x>
|
<property name="maximumSize">
|
||||||
<y>180</y>
|
<size>
|
||||||
<width>451</width>
|
<width>16777215</width>
|
||||||
<height>44</height>
|
<height>200</height>
|
||||||
</rect>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
<property name="text">
|
||||||
<property name="leftMargin">
|
<string/>
|
||||||
<number>9</number>
|
</property>
|
||||||
</property>
|
<property name="scaledContents">
|
||||||
<property name="rightMargin">
|
<bool>true</bool>
|
||||||
<number>0</number>
|
</property>
|
||||||
</property>
|
</widget>
|
||||||
<item>
|
</item>
|
||||||
<widget class="QLabel" name="label_6">
|
</layout>
|
||||||
<property name="text">
|
|
||||||
<string>Image</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLineEdit" name="imagePath"/>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QToolButton" name="toolButton">
|
|
||||||
<property name="text">
|
|
||||||
<string>...</string>
|
|
||||||
</property>
|
|
||||||
<property name="icon">
|
|
||||||
<iconset resource="build/Desktop_Qt_6_9_1-Debug/data.qrc">
|
|
||||||
<normaloff>:/data/images/data/images/add.png</normaloff>:/data/images/data/images/add.png</iconset>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="pushButton">
|
|
||||||
<property name="text">
|
|
||||||
<string>Select Image File</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
@ -276,19 +316,160 @@
|
|||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Step information</string>
|
<string>Step information</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignTop</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QFrame" name="frame_2">
|
<widget class="QFrame" name="stepInformationFrame">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="frameShape">
|
<property name="frameShape">
|
||||||
<enum>QFrame::Shape::StyledPanel</enum>
|
<enum>QFrame::Shape::NoFrame</enum>
|
||||||
</property>
|
|
||||||
<property name="frameShadow">
|
|
||||||
<enum>QFrame::Shadow::Raised</enum>
|
|
||||||
</property>
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||||
|
<item>
|
||||||
|
<widget class="QWidget" name="steptitleFrame" native="true">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_7">
|
||||||
|
<item>
|
||||||
|
<widget class="QSpinBox" name="stepNumber">
|
||||||
|
<property name="minimum">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="stepTitle"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="addStep">
|
||||||
|
<property name="text">
|
||||||
|
<string>...</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="data.qrc">
|
||||||
|
<normaloff>:/data/images/data/images/add.png</normaloff>:/data/images/data/images/add.png</iconset>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QWidget" name="stepCoordinatesFrame" native="true">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_11">
|
||||||
|
<item>
|
||||||
|
<widget class="QWidget" name="latFrame" native="true">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_8">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="latLbl">
|
||||||
|
<property name="text">
|
||||||
|
<string>Latitude</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignmentFlag::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QDoubleSpinBox" name="LatitudeSpin">
|
||||||
|
<property name="decimals">
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<double>90.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QWidget" name="longFrame" native="true">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_9">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="longLbl">
|
||||||
|
<property name="text">
|
||||||
|
<string>Longitude</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignmentFlag::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QDoubleSpinBox" name="longitudeSpin">
|
||||||
|
<property name="decimals">
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<double>-180.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<double>180.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QWidget" name="responseFrame" native="true">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_10">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="responseLbl">
|
||||||
|
<property name="text">
|
||||||
|
<string>Response</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignmentFlag::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QSpinBox" name="responseSpin"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPlainTextEdit" name="dialogEdit">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>255</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="backgroundVisible">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="validateBtn">
|
||||||
|
<property name="text">
|
||||||
|
<string>Valider</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
@ -310,15 +491,8 @@
|
|||||||
<addaction name="actionSave"/>
|
<addaction name="actionSave"/>
|
||||||
<addaction name="actionSave_as"/>
|
<addaction name="actionSave_as"/>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QMenu" name="menuEdit">
|
|
||||||
<property name="title">
|
|
||||||
<string>Edit</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<addaction name="menuFile"/>
|
<addaction name="menuFile"/>
|
||||||
<addaction name="menuEdit"/>
|
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QStatusBar" name="statusbar"/>
|
|
||||||
<widget class="QToolBar" name="toolBar">
|
<widget class="QToolBar" name="toolBar">
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>toolBar</string>
|
<string>toolBar</string>
|
||||||
@ -330,7 +504,7 @@
|
|||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</attribute>
|
</attribute>
|
||||||
<addaction name="actionNewFile"/>
|
<addaction name="actionNewFile"/>
|
||||||
<addaction name="actionNew"/>
|
<addaction name="actionopenFile"/>
|
||||||
<addaction name="actionSaveFile"/>
|
<addaction name="actionSaveFile"/>
|
||||||
<addaction name="actionSaveAsFile"/>
|
<addaction name="actionSaveAsFile"/>
|
||||||
<addaction name="actionPrintFile"/>
|
<addaction name="actionPrintFile"/>
|
||||||
@ -368,11 +542,11 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionNewFile">
|
<action name="actionNewFile">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="build/Desktop_Qt_6_9_1-Debug/data.qrc">
|
<iconset resource="data.qrc">
|
||||||
<normaloff>:/data/images/data/images/new.png</normaloff>:/data/images/data/images/new.png</iconset>
|
<normaloff>:/data/images/data/images/new.png</normaloff>:/data/images/data/images/new.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>NewFile</string>
|
<string>New File</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="menuRole">
|
<property name="menuRole">
|
||||||
<enum>QAction::MenuRole::NoRole</enum>
|
<enum>QAction::MenuRole::NoRole</enum>
|
||||||
@ -380,11 +554,11 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionSaveFile">
|
<action name="actionSaveFile">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="build/Desktop_Qt_6_9_1-Debug/data.qrc">
|
<iconset resource="data.qrc">
|
||||||
<normaloff>:/data/images/data/images/save_as.png</normaloff>:/data/images/data/images/save_as.png</iconset>
|
<normaloff>:/data/images/data/images/save_as.png</normaloff>:/data/images/data/images/save_as.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>SaveFile</string>
|
<string>Save</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="menuRole">
|
<property name="menuRole">
|
||||||
<enum>QAction::MenuRole::NoRole</enum>
|
<enum>QAction::MenuRole::NoRole</enum>
|
||||||
@ -392,11 +566,11 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionSaveAsFile">
|
<action name="actionSaveAsFile">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="build/Desktop_Qt_6_9_1-Debug/data.qrc">
|
<iconset resource="data.qrc">
|
||||||
<normaloff>:/data/images/data/images/save.png</normaloff>:/data/images/data/images/save.png</iconset>
|
<normaloff>:/data/images/data/images/save.png</normaloff>:/data/images/data/images/save.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>SaveAsFile</string>
|
<string>Save as</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="menuRole">
|
<property name="menuRole">
|
||||||
<enum>QAction::MenuRole::NoRole</enum>
|
<enum>QAction::MenuRole::NoRole</enum>
|
||||||
@ -404,11 +578,11 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionPrintFile">
|
<action name="actionPrintFile">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="build/Desktop_Qt_6_9_1-Debug/data.qrc">
|
<iconset resource="data.qrc">
|
||||||
<normaloff>:/data/images/data/images/print.png</normaloff>:/data/images/data/images/print.png</iconset>
|
<normaloff>:/data/images/data/images/print.png</normaloff>:/data/images/data/images/print.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>PrintFile</string>
|
<string>Print</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="menuRole">
|
<property name="menuRole">
|
||||||
<enum>QAction::MenuRole::NoRole</enum>
|
<enum>QAction::MenuRole::NoRole</enum>
|
||||||
@ -416,11 +590,11 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionEditCopy">
|
<action name="actionEditCopy">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="build/Desktop_Qt_6_9_1-Debug/data.qrc">
|
<iconset resource="data.qrc">
|
||||||
<normaloff>:/data/images/data/images/copy.png</normaloff>:/data/images/data/images/copy.png</iconset>
|
<normaloff>:/data/images/data/images/copy.png</normaloff>:/data/images/data/images/copy.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>EditCopy</string>
|
<string>Copy</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="menuRole">
|
<property name="menuRole">
|
||||||
<enum>QAction::MenuRole::NoRole</enum>
|
<enum>QAction::MenuRole::NoRole</enum>
|
||||||
@ -428,11 +602,11 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionEditPaste">
|
<action name="actionEditPaste">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="build/Desktop_Qt_6_9_1-Debug/data.qrc">
|
<iconset resource="data.qrc">
|
||||||
<normaloff>:/data/images/data/images/paste.png</normaloff>:/data/images/data/images/paste.png</iconset>
|
<normaloff>:/data/images/data/images/paste.png</normaloff>:/data/images/data/images/paste.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>EditPaste</string>
|
<string>Paste</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="menuRole">
|
<property name="menuRole">
|
||||||
<enum>QAction::MenuRole::NoRole</enum>
|
<enum>QAction::MenuRole::NoRole</enum>
|
||||||
@ -440,11 +614,11 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionEditCut">
|
<action name="actionEditCut">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="build/Desktop_Qt_6_9_1-Debug/data.qrc">
|
<iconset resource="data.qrc">
|
||||||
<normaloff>:/data/images/data/images/cut.png</normaloff>:/data/images/data/images/cut.png</iconset>
|
<normaloff>:/data/images/data/images/cut.png</normaloff>:/data/images/data/images/cut.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>EditCut</string>
|
<string>Cut</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="menuRole">
|
<property name="menuRole">
|
||||||
<enum>QAction::MenuRole::NoRole</enum>
|
<enum>QAction::MenuRole::NoRole</enum>
|
||||||
@ -452,11 +626,11 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionEditUndo">
|
<action name="actionEditUndo">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="build/Desktop_Qt_6_9_1-Debug/data.qrc">
|
<iconset resource="data.qrc">
|
||||||
<normaloff>:/data/images/data/images/edit_undo.png</normaloff>:/data/images/data/images/edit_undo.png</iconset>
|
<normaloff>:/data/images/data/images/edit_undo.png</normaloff>:/data/images/data/images/edit_undo.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>EditUndo</string>
|
<string>Undo</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="menuRole">
|
<property name="menuRole">
|
||||||
<enum>QAction::MenuRole::NoRole</enum>
|
<enum>QAction::MenuRole::NoRole</enum>
|
||||||
@ -464,23 +638,23 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionEditRedo">
|
<action name="actionEditRedo">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="build/Desktop_Qt_6_9_1-Debug/data.qrc">
|
<iconset resource="data.qrc">
|
||||||
<normaloff>:/data/images/data/images/edit_redo.png</normaloff>:/data/images/data/images/edit_redo.png</iconset>
|
<normaloff>:/data/images/data/images/edit_redo.png</normaloff>:/data/images/data/images/edit_redo.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>EditRedo</string>
|
<string>Redo</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="menuRole">
|
<property name="menuRole">
|
||||||
<enum>QAction::MenuRole::NoRole</enum>
|
<enum>QAction::MenuRole::NoRole</enum>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionNew">
|
<action name="actionopenFile">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="build/Desktop_Qt_6_9_1-Debug/data.qrc">
|
<iconset resource="data.qrc">
|
||||||
<normaloff>:/data/images/data/images/new.png</normaloff>:/data/images/data/images/new.png</iconset>
|
<normaloff>:/data/images/data/images/open.png</normaloff>:/data/images/data/images/open.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>New</string>
|
<string>Open file</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="menuRole">
|
<property name="menuRole">
|
||||||
<enum>QAction::MenuRole::NoRole</enum>
|
<enum>QAction::MenuRole::NoRole</enum>
|
||||||
@ -488,7 +662,7 @@
|
|||||||
</action>
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="build/Desktop_Qt_6_9_1-Debug/data.qrc"/>
|
<include location="data.qrc"/>
|
||||||
</resources>
|
</resources>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
|||||||
37
path.cpp
37
path.cpp
@ -45,11 +45,46 @@ QString Path::getImage() const
|
|||||||
return image;
|
return image;
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<Step> Path::getStep() const
|
QList<Step>& Path::getStep()
|
||||||
{
|
{
|
||||||
return step;
|
return step;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Path::setCity(const QString &newCity)
|
||||||
|
{
|
||||||
|
city = newCity;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Path::setDepartement(int newDepartement)
|
||||||
|
{
|
||||||
|
departement = newDepartement;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Path::setName(const QString &newName)
|
||||||
|
{
|
||||||
|
name = newName;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Path::setDifficulty(unsigned int newDifficulty)
|
||||||
|
{
|
||||||
|
difficulty = newDifficulty;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Path::setDuration(float newDuration)
|
||||||
|
{
|
||||||
|
duration = newDuration;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Path::setLength(float newLength)
|
||||||
|
{
|
||||||
|
length = newLength;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Path::setImage(const QString &newImage)
|
||||||
|
{
|
||||||
|
image = newImage;
|
||||||
|
}
|
||||||
|
|
||||||
Path::Path(QFile *file){
|
Path::Path(QFile *file){
|
||||||
if (!file->open(QIODevice::ReadOnly)) {
|
if (!file->open(QIODevice::ReadOnly)) {
|
||||||
qWarning() << "Could not open file:" << file->errorString();
|
qWarning() << "Could not open file:" << file->errorString();
|
||||||
|
|||||||
9
path.h
9
path.h
@ -28,7 +28,14 @@ public:
|
|||||||
float getDuration() const;
|
float getDuration() const;
|
||||||
float getLength() const;
|
float getLength() const;
|
||||||
QString getImage() const;
|
QString getImage() const;
|
||||||
QList<Step> getStep() const;
|
QList<Step>& getStep();
|
||||||
|
void setCity(const QString &newCity);
|
||||||
|
void setDepartement(int newDepartement);
|
||||||
|
void setName(const QString &newName);
|
||||||
|
void setDifficulty(unsigned int newDifficulty);
|
||||||
|
void setDuration(float newDuration);
|
||||||
|
void setLength(float newLength);
|
||||||
|
void setImage(const QString &newImage);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // PATH_H
|
#endif // PATH_H
|
||||||
|
|||||||
@ -16,6 +16,7 @@ SOURCES += \
|
|||||||
web.cpp
|
web.cpp
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
|
Undo.h \
|
||||||
mainwindow.h \
|
mainwindow.h \
|
||||||
step.h \
|
step.h \
|
||||||
path.h \
|
path.h \
|
||||||
|
|||||||
34
step.cpp
34
step.cpp
@ -64,6 +64,16 @@ Step::Step() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QList<QString> Step::getPersonnage() const
|
||||||
|
{
|
||||||
|
return personnage;
|
||||||
|
}
|
||||||
|
|
||||||
|
QList<QString> Step::getTexte() const
|
||||||
|
{
|
||||||
|
return texte;
|
||||||
|
}
|
||||||
|
|
||||||
Step::Step( QJsonObject &in)
|
Step::Step( QJsonObject &in)
|
||||||
{
|
{
|
||||||
title = in["title"].toString();
|
title = in["title"].toString();
|
||||||
@ -71,7 +81,7 @@ Step::Step( QJsonObject &in)
|
|||||||
QString gps = in["GPS"].toString();
|
QString gps = in["GPS"].toString();
|
||||||
QStringList parts = gps.split(" ", Qt::SkipEmptyParts);
|
QStringList parts = gps.split(" ", Qt::SkipEmptyParts);
|
||||||
|
|
||||||
QChar latDir = parts[0][0]; // c'est le premier QChar du QString t'as capté
|
QChar latDir = parts[0][0];
|
||||||
int latDeg = parts[1].toInt();
|
int latDeg = parts[1].toInt();
|
||||||
float latMin = parts[2].toFloat();
|
float latMin = parts[2].toFloat();
|
||||||
setLatitude(latDeg, latMin, latDir);
|
setLatitude(latDeg, latMin, latDir);
|
||||||
@ -110,3 +120,25 @@ void Step::setLongitude(int degree, float minute, QChar EW)
|
|||||||
if (EW.toUpper() == 'W')
|
if (EW.toUpper() == 'W')
|
||||||
longitude = -longitude;
|
longitude = -longitude;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString Step::toGPSFormat(){
|
||||||
|
int latDeg = static_cast<int>(latitude);
|
||||||
|
float latMin = (latitude - latDeg) * 60.0;
|
||||||
|
QChar latDir = latitude >= 0 ? 'N' : 'S';
|
||||||
|
latDeg = abs(latDeg);
|
||||||
|
|
||||||
|
int lonDeg = static_cast<int>(longitude);
|
||||||
|
float lonMin = (longitude - lonDeg) * 60.0;
|
||||||
|
QChar lonDir = longitude >= 0 ? 'E' : 'W';
|
||||||
|
lonDeg = abs(lonDeg);
|
||||||
|
|
||||||
|
QString gpsString = QString("%1 %2 %3 %4 %5 %6")
|
||||||
|
.arg(latDir)
|
||||||
|
.arg(latDeg, 2)
|
||||||
|
.arg(latMin, 5, 'f', 3)
|
||||||
|
.arg(lonDir)
|
||||||
|
.arg(lonDeg, 2)
|
||||||
|
.arg(lonMin, 5, 'f', 3);
|
||||||
|
|
||||||
|
return gpsString;
|
||||||
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user