diff options
-rw-r--r-- | .qmake.conf | 2 | ||||
-rw-r--r-- | dist/changes-5.12.0 | 18 | ||||
-rw-r--r-- | src/imports/.gitattributes | 2 | ||||
-rw-r--r-- | src/imports/.gitignore | 2 | ||||
-rw-r--r-- | src/imports/webview.cpp | 9 | ||||
-rw-r--r-- | src/plugins/darwin/qdarwinwebview.mm | 49 | ||||
-rw-r--r-- | src/plugins/darwin/qdarwinwebview_p.h | 3 | ||||
-rw-r--r-- | src/plugins/webengine/webengine.pro | 2 |
8 files changed, 51 insertions, 36 deletions
diff --git a/.qmake.conf b/.qmake.conf index 5becd3e..d4aef77 100644 --- a/.qmake.conf +++ b/.qmake.conf @@ -2,4 +2,4 @@ load(qt_build_config) DEFINES += QT_NO_FOREACH -MODULE_VERSION = 5.11.3 +MODULE_VERSION = 5.12.0 diff --git a/dist/changes-5.12.0 b/dist/changes-5.12.0 new file mode 100644 index 0000000..4f6c63e --- /dev/null +++ b/dist/changes-5.12.0 @@ -0,0 +1,18 @@ +Qt 5.12 introduces many new features and improvements as well as bugfixes +over the 5.11.x series. For more details, refer to the online documentation +included in this distribution. The documentation is also available online: + +https://doc.qt.io/qt-5/index.html + +The Qt version 5.12 series is binary compatible with the 5.11.x series. +Applications compiled for 5.11 will continue to run with 5.12. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + +https://bugreports.qt.io/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + + - This release contains only minor code improvements. diff --git a/src/imports/.gitattributes b/src/imports/.gitattributes new file mode 100644 index 0000000..3b71b25 --- /dev/null +++ b/src/imports/.gitattributes @@ -0,0 +1,2 @@ +.gitignore export-ignore +.gitattributes export-ignore diff --git a/src/imports/.gitignore b/src/imports/.gitignore new file mode 100644 index 0000000..af54508 --- /dev/null +++ b/src/imports/.gitignore @@ -0,0 +1,2 @@ +# Created during builds: +/qmldir diff --git a/src/imports/webview.cpp b/src/imports/webview.cpp index ca10e29..792d7fa 100644 --- a/src/imports/webview.cpp +++ b/src/imports/webview.cpp @@ -40,13 +40,6 @@ #include <QtWebView/private/qquickwebviewloadrequest_p.h> #include <QtWebView/private/qquickwebview_p.h> -static void initResources() -{ -#ifdef QT_STATIC - Q_INIT_RESOURCE(qmake_QtWebView); -#endif -} - QT_BEGIN_NAMESPACE class QWebViewModule : public QQmlExtensionPlugin @@ -54,7 +47,7 @@ class QWebViewModule : public QQmlExtensionPlugin Q_OBJECT Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) public: - QWebViewModule(QObject *parent = 0) : QQmlExtensionPlugin(parent) { initResources(); } + QWebViewModule(QObject *parent = 0) : QQmlExtensionPlugin(parent) { } void registerTypes(const char *uri) { Q_ASSERT(QLatin1String(uri) == QLatin1String("QtWebView")); diff --git a/src/plugins/darwin/qdarwinwebview.mm b/src/plugins/darwin/qdarwinwebview.mm index 66bb61f..e82771f 100644 --- a/src/plugins/darwin/qdarwinwebview.mm +++ b/src/plugins/darwin/qdarwinwebview.mm @@ -160,49 +160,50 @@ QT_END_NAMESPACE - (void)webView:(WKWebView *)webView didStartProvisionalNavigation:(WKNavigation *)navigation { Q_UNUSED(webView); - Q_UNUSED(navigation); // WKNavigationDelegate gives us per-frame notifications while the QWebView API - // should provide per-page notifications. Keep track of started frame loads - // and emit notifications when the final frame completes. - if (++qDarwinWebViewPrivate->requestFrameCount == 1) { - Q_EMIT qDarwinWebViewPrivate->loadingChanged( - QWebViewLoadRequestPrivate(qDarwinWebViewPrivate->url(), - QWebView::LoadStartedStatus, - QString())); - } + // should provide per-page notifications. Therefore we keep track of the last frame + // to be started, if that finishes or fails then we indicate that it has loaded. + if (qDarwinWebViewPrivate->wkNavigation != navigation) + qDarwinWebViewPrivate->wkNavigation = navigation; + else + return; + Q_EMIT qDarwinWebViewPrivate->loadingChanged( + QWebViewLoadRequestPrivate(qDarwinWebViewPrivate->url(), + QWebView::LoadStartedStatus, + QString())); Q_EMIT qDarwinWebViewPrivate->loadProgressChanged(qDarwinWebViewPrivate->loadProgress()); } - (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation { Q_UNUSED(webView); - Q_UNUSED(navigation); - if (--qDarwinWebViewPrivate->requestFrameCount == 0) { - [self pageDone]; - Q_EMIT qDarwinWebViewPrivate->loadingChanged( - QWebViewLoadRequestPrivate(qDarwinWebViewPrivate->url(), - QWebView::LoadSucceededStatus, - QString())); - } + if (qDarwinWebViewPrivate->wkNavigation != navigation) + return; + + [self pageDone]; + Q_EMIT qDarwinWebViewPrivate->loadingChanged( + QWebViewLoadRequestPrivate(qDarwinWebViewPrivate->url(), + QWebView::LoadSucceededStatus, + QString())); } - (void)webView:(WKWebView *)webView didFailProvisionalNavigation:(WKNavigation *)navigation withError:(NSError *)error { Q_UNUSED(webView); - Q_UNUSED(navigation); - if (--qDarwinWebViewPrivate->requestFrameCount == 0) - [self handleError:error]; + if (qDarwinWebViewPrivate->wkNavigation != navigation) + return; + [self handleError:error]; } - (void)webView:(WKWebView *)webView didFailNavigation:(WKNavigation *)navigation withError:(NSError *)error { Q_UNUSED(webView); - Q_UNUSED(navigation); - if (--qDarwinWebViewPrivate->requestFrameCount == 0) - [self handleError:error]; + if (qDarwinWebViewPrivate->wkNavigation != navigation) + return; + [self handleError:error]; } - (void)webView:(WKWebView *)webView @@ -304,8 +305,6 @@ QUrl QDarwinWebViewPrivate::url() const void QDarwinWebViewPrivate::setUrl(const QUrl &url) { if (url.isValid()) { - requestFrameCount = 0; - if (url.isLocalFile()) { // We need to pass local files via loadFileURL and the read access should cover // the directory that the file is in, to facilitate loading referenced images etc diff --git a/src/plugins/darwin/qdarwinwebview_p.h b/src/plugins/darwin/qdarwinwebview_p.h index 8bc9c13..96fb09e 100644 --- a/src/plugins/darwin/qdarwinwebview_p.h +++ b/src/plugins/darwin/qdarwinwebview_p.h @@ -67,6 +67,7 @@ #endif Q_FORWARD_DECLARE_OBJC_CLASS(WKWebView); +Q_FORWARD_DECLARE_OBJC_CLASS(WKNavigation); #ifdef Q_OS_IOS Q_FORWARD_DECLARE_OBJC_CLASS(UIGestureRecognizer); @@ -109,10 +110,10 @@ protected: public: WKWebView *wkWebView; + WKNavigation *wkNavigation; #ifdef Q_OS_IOS UIGestureRecognizer *m_recognizer; #endif - int requestFrameCount; QPointer<QObject> m_parentView; }; diff --git a/src/plugins/webengine/webengine.pro b/src/plugins/webengine/webengine.pro index b0a03ac..9257ac0 100644 --- a/src/plugins/webengine/webengine.pro +++ b/src/plugins/webengine/webengine.pro @@ -4,7 +4,7 @@ PLUGIN_TYPE = webview PLUGIN_CLASS_NAME = QWebEngineWebViewPlugin load(qt_plugin) -QT += core gui webengine-private webview-private +QT += core gui webengine-private webenginecore-private webview-private HEADERS += \ qwebenginewebview_p.h |