1) Fixed compilation issue with QT4.

2) Make trigger action 'RequestClose' backword compatible with annulen webkit.
pull/5/merge
Neel Patel 2017-05-10 13:34:39 +05:30 committed by Akshay Joshi
parent cbf2de6c27
commit 3ed00d3be7
2 changed files with 12 additions and 3 deletions

View File

@ -835,9 +835,16 @@ void BrowserWindow::closetabs()
webviewPtr = dynamic_cast<WebViewWindow*>(widgetPtr);
if (webviewPtr != NULL)
{
// Trigger the action for tab window close so unload event
// will be called and resources will be freed properly.
webviewPtr->page()->triggerAction(QWebPage::RequestClose);
/* Trigger the action for tab window close so unload event will be called and
* resources will be freed properly.
* Trigger 'RequestClose' action from Qt5 onwards. Here we have triggerred the action
* 'ToggleVideoFullscreen + 1' because we do not know from which webkit
* version 'RequestClose' action was added so increment with previous enum value so that
* it will be backward webkit version compatible.
*/
#if QT_VERSION >= 0x050000
webviewPtr->page()->triggerAction(static_cast<QWebPage::WebAction>(QWebPage::ToggleVideoFullscreen + 1));
#endif
}
}
}

View File

@ -33,6 +33,8 @@
#include <QtWebEngineView>
#else
#include <QWebView>
#include <QNetworkCookieJar>
#include <QNetworkAccessManager>
#endif
#endif