diff options
author | Liang Qi <liang.qi@qt.io> | 2017-06-12 15:14:47 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2017-06-12 15:14:47 +0200 |
commit | a358507336d69467011cd80e8fffcb20dc5d013a (patch) | |
tree | 24b9e0ece7fd97ffbde858e876b993a34c6be7e6 | |
parent | cd383f858ba63199c2a7b1a498d3da9d6b731212 (diff) | |
parent | c795aad0aa9ff62da8d48dfa4b4c92bd55a18e45 (diff) |
Merge remote-tracking branch 'origin/5.9' into dev
Conflicts:
.qmake.conf
Change-Id: I9e8dc643809bae2641417d6d1987b1d6a3edca0b
-rw-r--r-- | dist/changes-5.8.0 | 32 | ||||
-rw-r--r-- | dist/changes-5.9.0 | 43 | ||||
-rw-r--r-- | src/imports/webview.cpp | 8 | ||||
-rw-r--r-- | src/webview/qquickwebview.cpp | 9 | ||||
-rw-r--r-- | src/webview/qquickwebview_p.h | 1 | ||||
-rw-r--r-- | src/webview/qwebview_webengine.cpp | 6 | ||||
-rw-r--r-- | src/webview/qwebview_webengine_p.h | 1 |
7 files changed, 100 insertions, 0 deletions
diff --git a/dist/changes-5.8.0 b/dist/changes-5.8.0 new file mode 100644 index 0000000..56df082 --- /dev/null +++ b/dist/changes-5.8.0 @@ -0,0 +1,32 @@ +Qt 5.8 introduces many new features and improvements as well as bugfixes +over the 5.7.x series. For more details, refer to the online documentation +included in this distribution. The documentation is also available online: + + http://doc.qt.io/qt-5/index.html + +The Qt version 5.8 series is binary compatible with the 5.7.x series. +Applications compiled for 5.7 will continue to run with 5.8. + +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. + +Android +------- + + - Added support for various url schemes. + +macOS / iOS +----------- +- [QTBUG-48996] Added WKWebView backend for macOS 10.10 and iOS 8.0, or + newer. + +General +------- + + - [QTBUG-54128] Fixed missing geometry update bug when a webview changed + anchestor (e.g. when pushing it onto a StackView). diff --git a/dist/changes-5.9.0 b/dist/changes-5.9.0 new file mode 100644 index 0000000..c68eea4 --- /dev/null +++ b/dist/changes-5.9.0 @@ -0,0 +1,43 @@ +Qt 5.9 introduces many new features and improvements as well as bugfixes +over the 5.8.x series. For more details, refer to the online documentation +included in this distribution. The documentation is also available online: + +http://doc.qt.io/qt-5/index.html + +The Qt version 5.9 series is binary compatible with the 5.8.x series. +Applications compiled for 5.8 will continue to run with 5.9. + +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. + +**************************************************************************** +* Library * +**************************************************************************** + + - [QTBUG-59559] Fixed bundling of module resources for static builds. + + - [QTBUG-60150] The WebView will now receive the active focus when + forceActiveFocus is called. + + - [QTBUG-57284] Fixed QtWebEngine dependency for the qml plugin. + +**************************************************************************** +* Platform-specific Changes * +**************************************************************************** + +WinRT +----- + +- [QTBUG-57288] Removed support for WinRT 8.1 and Windows Phone 8.1. + +macOS & iOS +----------- + + - Removed WebView and UIWebView backends. Minimum deployment target is + now macOS 10.10 and iOS 8.0, so the WKWebView backend is used for both + platforms. diff --git a/src/imports/webview.cpp b/src/imports/webview.cpp index f4e0c70..ca10e29 100644 --- a/src/imports/webview.cpp +++ b/src/imports/webview.cpp @@ -40,6 +40,13 @@ #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 @@ -47,6 +54,7 @@ class QWebViewModule : public QQmlExtensionPlugin Q_OBJECT Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) public: + QWebViewModule(QObject *parent = 0) : QQmlExtensionPlugin(parent) { initResources(); } void registerTypes(const char *uri) { Q_ASSERT(QLatin1String(uri) == QLatin1String("QtWebView")); diff --git a/src/webview/qquickwebview.cpp b/src/webview/qquickwebview.cpp index d760564..a486088 100644 --- a/src/webview/qquickwebview.cpp +++ b/src/webview/qquickwebview.cpp @@ -39,6 +39,7 @@ #include <QtWebView/private/qwebviewloadrequest_p.h> #include <QtQml/qqmlengine.h> #include <QtCore/qmutex.h> +#include <QtCore/QDebug> namespace { @@ -291,6 +292,14 @@ void QQuickWebView::runJavaScriptPrivate(const QString &script, int callbackId) m_webView->runJavaScriptPrivate(script, callbackId); } +void QQuickWebView::itemChange(ItemChange change, const ItemChangeData &value) +{ + if (change == QQuickItem::ItemActiveFocusHasChanged) { + m_webView->setFocus(value.boolValue); + } + QQuickItem::itemChange(change, value); +} + void QQuickWebView::onRunJavaScriptResult(int id, const QVariant &variant) { if (id == -1) diff --git a/src/webview/qquickwebview_p.h b/src/webview/qquickwebview_p.h index 3d1a432..6534815 100644 --- a/src/webview/qquickwebview_p.h +++ b/src/webview/qquickwebview_p.h @@ -103,6 +103,7 @@ Q_SIGNALS: void loadProgressChanged(); protected: + void itemChange(ItemChange change, const ItemChangeData &value) Q_DECL_OVERRIDE; void runJavaScriptPrivate(const QString& script, int callbackId) Q_DECL_OVERRIDE; diff --git a/src/webview/qwebview_webengine.cpp b/src/webview/qwebview_webengine.cpp index e7d09e2..6ea9872 100644 --- a/src/webview/qwebview_webengine.cpp +++ b/src/webview/qwebview_webengine.cpp @@ -147,6 +147,12 @@ void QWebEngineWebViewPrivate::setVisible(bool visible) m_webEngineView->setVisible(visible); } +void QWebEngineWebViewPrivate::setFocus(bool focus) +{ + if (focus) + m_webEngineView->forceActiveFocus(); +} + int QWebEngineWebViewPrivate::loadProgress() const { return m_webEngineView->loadProgress(); diff --git a/src/webview/qwebview_webengine_p.h b/src/webview/qwebview_webengine_p.h index 623b455..16dd773 100644 --- a/src/webview/qwebview_webengine_p.h +++ b/src/webview/qwebview_webengine_p.h @@ -81,6 +81,7 @@ public: void setGeometry(const QRect &geometry) Q_DECL_OVERRIDE; void setVisibility(QWindow::Visibility visibility) Q_DECL_OVERRIDE; void setVisible(bool visible) Q_DECL_OVERRIDE; + void setFocus(bool focus) Q_DECL_OVERRIDE; public Q_SLOTS: void goBack() Q_DECL_OVERRIDE; |