classe web+ test main
This commit is contained in:
@@ -3,25 +3,45 @@
|
||||
#include <QApplication>
|
||||
#include <step.h>
|
||||
#include <QFile>
|
||||
|
||||
#include <web.h>
|
||||
using namespace std;
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
MainWindow w;
|
||||
QFile file("data/parcours1.json");
|
||||
if (!file.open(QIODevice::ReadOnly)) {
|
||||
QFile file1("data/parcours1.json");
|
||||
if (!file1.open(QIODevice::ReadOnly)) {
|
||||
qWarning() << "Impossible d'ouvrir le fichier data/parcours1.json";
|
||||
return -1;
|
||||
}
|
||||
Path* p = new Path(&file);
|
||||
file.close();
|
||||
Path* p = new Path(&file1);
|
||||
file1.close();
|
||||
|
||||
QFile file2("data/parcours1.json");
|
||||
if (!file2.open(QIODevice::ReadOnly)) {
|
||||
qWarning() << "Impossible d'ouvrir le fichier data/parcours2.json";
|
||||
delete p;
|
||||
return -1;
|
||||
}
|
||||
Path* p2 = new Path(&file2);
|
||||
file2.close();
|
||||
|
||||
QList<Path*> paths = w.getPath();
|
||||
paths.append(p);
|
||||
paths.append(p2);
|
||||
w.setPath(paths);
|
||||
|
||||
w.setCurrentPath(p);
|
||||
w.exportHTMLMap();
|
||||
//w.show();
|
||||
|
||||
w.setCurrentPath(p2);
|
||||
w.exportHTMLMap();
|
||||
|
||||
Web u(w.getPath());
|
||||
u.siteHtml();
|
||||
|
||||
delete p;
|
||||
delete p2;
|
||||
|
||||
return a.exec();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user