add of web button to index.html
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user