Your ROOT_URL in app.ini is http://git.osmesh.ru/ but you are visiting http://91.221.70.94:3000/MOS/StoreTry/src/branch/master/webapp.cpp You should set ROOT_URL correctly, otherwise the web may not work correctly.
 
 
 
StoreTry/webapp.cpp

39 lines
861 B

#include "webapp.h"
#include "ui_webapp.h"
#include <QtCore/QVariant>
#include <QtWebEngineWidgets/QWebEngineView>
#include <QtWidgets/QApplication>
#include <QtWidgets/QMainWindow>
#include <QtWidgets/QMenuBar>
#include <QtWidgets/QStatusBar>
#include <QtWidgets/QWidget>
#include <QtWebEngineWidgets>
#include <QUrl>
#include <QWebElement>
#include <QWebFrame>
WebApp::WebApp(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::WebApp)
{
ui->setupUi(this);
}
void WebApp::setPath(QString _appPath)
{
ui->setupUi(this);
appPath = _appPath;
_lastUrl = QUrl::fromLocalFile(appPath+"/StoreMain.html");
ui->webEngineView->load(_lastUrl);
connect(ui->webEngineView, &QWebEngineView::urlChanged, this, &WebApp::onUrlChanged);
}
void WebApp::SetUrl()
{
ui->webEngineView->load(_lastUrl);
}
WebApp::~WebApp()
{
delete ui;
}