1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-14 19:12:11 +01:00

Workaround crash on drop with Qt 5.7.0

Closes #2060
This commit is contained in:
David Rosca 2016-08-23 19:48:22 +02:00
parent e56d01fec9
commit 8206dea201

View File

@ -350,6 +350,7 @@ void WebPage::renderProcessTerminated(QWebEnginePage::RenderProcessTerminationSt
if (terminationStatus == NormalTerminationStatus) if (terminationStatus == NormalTerminationStatus)
return; return;
#if QT_VERSION != QT_VERSION_CHECK(5, 7, 0) // Crashes with QtWebEngine 5.7.0
QTimer::singleShot(0, this, [this]() { QTimer::singleShot(0, this, [this]() {
QString page = QzTools::readAllFileContents(":html/tabcrash.html"); QString page = QzTools::readAllFileContents(":html/tabcrash.html");
page.replace(QL1S("%IMAGE%"), QzTools::pixmapToDataUrl(IconProvider::standardIcon(QStyle::SP_MessageBoxWarning).pixmap(45)).toString()); page.replace(QL1S("%IMAGE%"), QzTools::pixmapToDataUrl(IconProvider::standardIcon(QStyle::SP_MessageBoxWarning).pixmap(45)).toString());
@ -363,6 +364,7 @@ void WebPage::renderProcessTerminated(QWebEnginePage::RenderProcessTerminationSt
page = QzTools::applyDirectionToPage(page); page = QzTools::applyDirectionToPage(page);
setHtml(page.toUtf8(), url()); setHtml(page.toUtf8(), url());
}); });
#endif
} }
bool WebPage::acceptNavigationRequest(const QUrl &url, QWebEnginePage::NavigationType type, bool isMainFrame) bool WebPage::acceptNavigationRequest(const QUrl &url, QWebEnginePage::NavigationType type, bool isMainFrame)