# Conflicts: # data/parcours2.json # mainwindow.cpp # mainwindow.h # step.cpp # step.h
79 lines
1.7 KiB
C++
79 lines
1.7 KiB
C++
#ifndef MAINWINDOW_H
|
|
#define MAINWINDOW_H
|
|
|
|
#include <QMainWindow>
|
|
#include <QUndoStack>
|
|
#include <QClipboard>
|
|
#include "path.h"
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
namespace Ui {
|
|
class MainWindow;
|
|
}
|
|
QT_END_NAMESPACE
|
|
|
|
class MainWindow : public QMainWindow
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
MainWindow(QWidget *parent = nullptr);
|
|
~MainWindow();
|
|
void updatePathView();
|
|
void updateStepView(size_t num);
|
|
void onTextChanged();
|
|
void loadNewPath();
|
|
void loadPath(Path* p);
|
|
void loadStep(Step s);
|
|
void addNewPath();
|
|
void addNewStep();
|
|
void exportHTMLMap(int index);
|
|
void loadAndExportPaths();
|
|
QString getCurrentFile() const;
|
|
void setCurrentFile(const QString &newCurrentFile);
|
|
QList<Path *> getPath() const;
|
|
void setPath(const QList<Path *> &newPath);
|
|
Path *getCurrentPath() const;
|
|
void setCurrentPath(Path *newCurrentPath);
|
|
|
|
int getIndexPath() const;
|
|
void setIndexPath(int newIndexPath);
|
|
void exportHTMLMap();
|
|
void saveFile();
|
|
|
|
private slots:
|
|
void on_pushButton_clicked();
|
|
|
|
void on_actionOpen_triggered();
|
|
|
|
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:
|
|
Ui::MainWindow *ui;
|
|
QString currentFile;
|
|
static int indexPath;
|
|
bool textChanged;
|
|
QList<Path*> path;
|
|
Path* currentPath;
|
|
void loadImage(QString fileName);
|
|
QUndoStack *undoStack;
|
|
QClipboard* Clipboard;
|
|
};
|
|
#endif // MAINWINDOW_H
|