mirror of
https://gitee.com/js-yhsec/energy_storage.git
synced 2026-05-27 18:59:26 +08:00
修改场站策略解析及网关指令下发
This commit is contained in:
@@ -79,6 +79,12 @@ MainWeb::MainWeb()
|
||||
|
||||
void MainWeb::initWebview()
|
||||
{
|
||||
labelWebErr.setParent(this);
|
||||
labelWebErr.setGeometry(180, 100, 800, 50);
|
||||
labelWebErr.setText("WEB服务异常!!!");
|
||||
labelWebErr.setStyleSheet("font: bold 20px;");
|
||||
labelWebErr.hide();
|
||||
|
||||
qputenv("QTWEBENGINE_REMOTE_DEBUGGING", "9222"); // 即使内置视图,有时也需要开启调试端口
|
||||
//this->setCentralWidget(&webView);
|
||||
webView.setParent(this);
|
||||
@@ -104,11 +110,13 @@ void MainWeb::initWebview()
|
||||
if (ok)
|
||||
{
|
||||
webView.show();
|
||||
labelWebErr.hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
spdlog::error("[web] webview load failed, url={}", Config::option.webSrvUrl);
|
||||
webView.hide();
|
||||
labelWebErr.show();
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -186,8 +194,13 @@ bool MainWeb::event(QEvent* e)
|
||||
|
||||
void MainWeb::keyPressEvent(QKeyEvent* e)
|
||||
{
|
||||
if (e->key() == Qt::Key_F12)
|
||||
auto key = e->key();
|
||||
if (key == Qt::Key_F12)
|
||||
{
|
||||
this->showDevTools();
|
||||
}
|
||||
else if (key == Qt::Key_F5)
|
||||
{
|
||||
webView.load(QUrl(Config::option.webSrvUrl.c_str()));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user