add of web button to index.html

This commit is contained in:
Giovanni JOSSERAND
2025-06-21 14:26:12 +02:00
parent cf486f6e68
commit d69d10605e
4 changed files with 62 additions and 33 deletions
+22
View File
@@ -18,6 +18,9 @@
#include <QJsonObject>
#include <QJsonArray>
#include "web.h"
#include <QDesktopServices>
#include <QUrl>
#include <QFileInfo>
int MainWindow::indexPath = 0;
@@ -1050,3 +1053,22 @@ void MainWindow::on_addStep_clicked()
void MainWindow::on_actionExit_triggered() { QApplication::quit(); }
void MainWindow::openIndexSite() {
QString filePath = "index.html";
QFileInfo fileInfo(filePath);
if (fileInfo.exists() && fileInfo.isFile()) {
QDesktopServices::openUrl(QUrl::fromLocalFile(fileInfo.absoluteFilePath()));
} else {
QMessageBox::warning(this, "Erreur", "Le fichier index.html n'existe pas.");
}
}
void MainWindow::on_actionWeb_triggered()
{
this->openIndexSite();
}