fix: 修复 UOS 上加载 RC 页面始终处于加载中的问题

页面加载始终未触发 loadFinished 信号,判断加载未完成

Log: 添加 loadProgressChanged 信号处理,加载进度到 100% 就显示页面;loadFinished 信号如果报错,在窗口中提示“加载存在错误”
This commit is contained in:
zty199
2022-11-21 14:38:57 +08:00
parent eb2bdaca63
commit 4a81898cd3
7 changed files with 43 additions and 9 deletions

View File

@@ -265,8 +265,8 @@ void MainWindow::initConnections()
});
connect(m_tray, &QSystemTrayIcon::activated, this, &MainWindow::on_trayIconActivated);
connect(m_widget, &Widget::sigLoadErrorOccurred, this, &MainWindow::slotLoadErrorOccurred);
connect(m_widget->getPage()->profile(), &QWebEngineProfile::downloadRequested, this, &MainWindow::on_downloadStart);
connect(m_widget->getPage(), &QWebEnginePage::windowCloseRequested, this, [=]() {
this->close();
});
@@ -476,3 +476,8 @@ void MainWindow::on_downloadCancel(QWebEngineDownloadItem *item)
downloadMessage->hide();
DMessageManager::instance()->sendMessage(this, QIcon::fromTheme("dialog-error").pixmap(64, 64), QString(QObject::tr("%1Download canceled!")).arg(" "));
}
void MainWindow::slotLoadErrorOccurred()
{
DMessageManager::instance()->sendMessage(this, QIcon::fromTheme("dialog-warning").pixmap(64, 64), QString(QObject::tr("%1Load error occurred!")).arg(" "));
}