diff options
author | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2018-04-20 10:58:50 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2018-04-20 10:58:50 +0200 |
commit | 7fe519be4fd1c599a611ee83f76ef561fd73b1d3 (patch) | |
tree | 0e76f962f4b5428ff556b57a00029ccf9327adee | |
parent | ad6e1079a1edfff48bf18c25718f65a1d9f8008f (diff) | |
parent | 9861ce1ba35bbc29f20b65853e17b426c804c87c (diff) |
Merge 5.11 into 5.11.0
Change-Id: Ide3f60771813db37aac87fc7b7a8aae66d4fe1e0
-rw-r--r-- | examples/webengine/quicknanobrowser/BrowserDialog.qml | 2 | ||||
-rw-r--r-- | examples/webengine/quicknanobrowser/BrowserWindow.qml | 41 | ||||
-rw-r--r-- | examples/webengine/recipebrowser/resources/qml/main.qml | 6 | ||||
m--------- | src/3rdparty | 0 | ||||
-rw-r--r-- | src/core/web_engine_library_info.cpp | 29 | ||||
-rw-r--r-- | src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp | 5 |
6 files changed, 49 insertions, 34 deletions
diff --git a/examples/webengine/quicknanobrowser/BrowserDialog.qml b/examples/webengine/quicknanobrowser/BrowserDialog.qml index 770cfee6a..6b0b3acd6 100644 --- a/examples/webengine/quicknanobrowser/BrowserDialog.qml +++ b/examples/webengine/quicknanobrowser/BrowserDialog.qml @@ -64,7 +64,7 @@ Window { id: webView anchors.fill: parent - onGeometryChangeRequested: { + onGeometryChangeRequested: function(geometry) { window.x = geometry.x window.y = geometry.y window.width = geometry.width diff --git a/examples/webengine/quicknanobrowser/BrowserWindow.qml b/examples/webengine/quicknanobrowser/BrowserWindow.qml index 5e98997ee..fc9cd0253 100644 --- a/examples/webengine/quicknanobrowser/BrowserWindow.qml +++ b/examples/webengine/quicknanobrowser/BrowserWindow.qml @@ -206,8 +206,12 @@ ApplicationWindow { enabled: model.offset } - onObjectAdded: historyMenu.insertItem(index, object) - onObjectRemoved: historyMenu.removeItem(object) + onObjectAdded: function(index, object) { + historyMenu.insertItem(index, object) + } + onObjectRemoved: function(index, object) { + historyMenu.removeItem(object) + } } } } @@ -291,14 +295,18 @@ ApplicationWindow { text: "Off The Record" checkable: true checked: currentWebView.profile.offTheRecord - onToggled: currentWebView.profile = checked ? otrProfile : defaultProfile; + onToggled: function(checked) { + currentWebView.profile = checked ? otrProfile : defaultProfile; + } } MenuItem { id: httpDiskCacheEnabled text: "HTTP Disk Cache" checkable: !currentWebView.profile.offTheRecord checked: (currentWebView.profile.httpCacheType === WebEngineProfile.DiskHttpCache) - onToggled: currentWebView.profile.httpCacheType = checked ? WebEngineProfile.DiskHttpCache : WebEngineProfile.MemoryHttpCache + onToggled: function(checked) { + currentWebView.profile.httpCacheType = checked ? WebEngineProfile.DiskHttpCache : WebEngineProfile.MemoryHttpCache; + } } MenuItem { id: autoLoadIconsForPage @@ -368,8 +376,8 @@ ApplicationWindow { id: webEngineView focus: true - onLinkHovered: { - if (hoveredUrl == "") + onLinkHovered: function(hoveredUrl) { + if (hoveredUrl === "") resetStatusText.start(); else { resetStatusText.stop(); @@ -400,22 +408,22 @@ ApplicationWindow { settings.touchIconsEnabled: appSettings.touchIconsEnabled settings.webRTCPublicInterfacesOnly: appSettings.webRTCPublicInterfacesOnly - onCertificateError: { + onCertificateError: function(error) { error.defer(); sslDialog.enqueue(error); } - onNewViewRequested: { + onNewViewRequested: function(request) { if (!request.userInitiated) print("Warning: Blocked a popup window."); - else if (request.destination == WebEngineView.NewViewInTab) { + else if (request.destination === WebEngineView.NewViewInTab) { var tab = tabs.createEmptyTab(currentWebView.profile); tabs.currentIndex = tabs.count - 1; request.openIn(tab.item); - } else if (request.destination == WebEngineView.NewViewInBackgroundTab) { + } else if (request.destination === WebEngineView.NewViewInBackgroundTab) { var backgroundTab = tabs.createEmptyTab(currentWebView.profile); request.openIn(backgroundTab.item); - } else if (request.destination == WebEngineView.NewViewInDialog) { + } else if (request.destination === WebEngineView.NewViewInDialog) { var dialog = applicationRoot.createDialog(currentWebView.profile); request.openIn(dialog.currentWebView); } else { @@ -424,7 +432,7 @@ ApplicationWindow { } } - onFullScreenRequested: { + onFullScreenRequested: function(request) { if (request.toggleOn) { webEngineView.state = "FullScreen"; browserWindow.previousVisibility = browserWindow.visibility; @@ -438,19 +446,20 @@ ApplicationWindow { request.accept(); } - onQuotaRequested: { + onQuotaRequested: function(request) { if (request.requestedSize <= 5 * 1024 * 1024) request.accept(); else request.reject(); } - onRegisterProtocolHandlerRequested: { - print("accepting registerProtocolHandler request for " + request.scheme + " from " + request.origin); + onRegisterProtocolHandlerRequested: function(request) { + console.log("accepting registerProtocolHandler request for " + + request.scheme + " from " + request.origin); request.accept(); } - onRenderProcessTerminated: { + onRenderProcessTerminated: function(terminationStatus, exitCode) { var status = ""; switch (terminationStatus) { case WebEngineView.NormalTerminationStatus: diff --git a/examples/webengine/recipebrowser/resources/qml/main.qml b/examples/webengine/recipebrowser/resources/qml/main.qml index 899d307cf..2639b6b5d 100644 --- a/examples/webengine/recipebrowser/resources/qml/main.qml +++ b/examples/webengine/recipebrowser/resources/qml/main.qml @@ -99,7 +99,9 @@ ApplicationWindow { Layout.fillHeight: true focus: true KeyNavigation.tab: webView - onRecipeSelected: webView.showRecipe(url) + onRecipeSelected: function(url) { + webView.showRecipe(url) + } } WebEngineView { @@ -118,7 +120,7 @@ ApplicationWindow { } property bool firstLoadComplete: false - onLoadingChanged: { + onLoadingChanged: function(loadRequest) { if (loadRequest.status === WebEngineView.LoadSucceededStatus && !firstLoadComplete) { // Debounce the showing of the web content, so images are more likely diff --git a/src/3rdparty b/src/3rdparty -Subproject e173cb17d97aa3c2065189275c85db79eb7d174 +Subproject de120c712b755a45687b4f3a7fd01bb7d334669 diff --git a/src/core/web_engine_library_info.cpp b/src/core/web_engine_library_info.cpp index 35b139602..515f763d2 100644 --- a/src/core/web_engine_library_info.cpp +++ b/src/core/web_engine_library_info.cpp @@ -163,9 +163,9 @@ QString subProcessPath() #else candidatePaths << QLibraryInfo::location(QLibraryInfo::LibraryExecutablesPath) % QLatin1Char('/') % processBinary; +#endif candidatePaths << QCoreApplication::applicationDirPath() % QLatin1Char('/') % processBinary; -#endif } Q_FOREACH (const QString &candidate, candidatePaths) { @@ -185,11 +185,13 @@ QString subProcessPath() QString localesPath() { + static bool initialized = false; + static QString potentialLocalesPath = #if defined(OS_MACOSX) && defined(QT_MAC_FRAMEWORK_BUILD) - return getResourcesPath(frameworkBundle()) % QLatin1String("/qtwebengine_locales"); + getResourcesPath(frameworkBundle()) % QLatin1String("/qtwebengine_locales"); #else - static bool initialized = false; - static QString potentialLocalesPath = QLibraryInfo::location(QLibraryInfo::TranslationsPath) % QDir::separator() % QLatin1String("qtwebengine_locales"); + QLibraryInfo::location(QLibraryInfo::TranslationsPath) % QDir::separator() % QLatin1String("qtwebengine_locales"); +#endif if (!initialized) { initialized = true; @@ -204,7 +206,6 @@ QString localesPath() } return potentialLocalesPath; -#endif } #if BUILDFLAG(ENABLE_SPELLCHECK) @@ -257,11 +258,13 @@ QString dictionariesPath() QString icuDataPath() { + static bool initialized = false; + static QString potentialResourcesPath = #if defined(OS_MACOSX) && defined(QT_MAC_FRAMEWORK_BUILD) - return getResourcesPath(frameworkBundle()); + getResourcesPath(frameworkBundle()); #else - static bool initialized = false; - static QString potentialResourcesPath = QLibraryInfo::location(QLibraryInfo::DataPath) % QLatin1String("/resources"); + QLibraryInfo::location(QLibraryInfo::DataPath) % QLatin1String("/resources"); +#endif if (!initialized) { initialized = true; if (!QFileInfo::exists(potentialResourcesPath % QLatin1String("/icudtl.dat"))) { @@ -279,16 +282,17 @@ QString icuDataPath() } return potentialResourcesPath; -#endif } QString resourcesDataPath() { + static bool initialized = false; + static QString potentialResourcesPath = #if defined(OS_MACOSX) && defined(QT_MAC_FRAMEWORK_BUILD) - return getResourcesPath(frameworkBundle()); + getResourcesPath(frameworkBundle()); #else - static bool initialized = false; - static QString potentialResourcesPath = QLibraryInfo::location(QLibraryInfo::DataPath) % QLatin1String("/resources"); + QLibraryInfo::location(QLibraryInfo::DataPath) % QLatin1String("/resources"); +#endif if (!initialized) { initialized = true; if (!QFileInfo::exists(potentialResourcesPath % QLatin1String("/qtwebengine_resources.pak"))) { @@ -306,7 +310,6 @@ QString resourcesDataPath() } return potentialResourcesPath; -#endif } } // namespace diff --git a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp index 9e2f6ed99..16ea216f2 100644 --- a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp +++ b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp @@ -269,6 +269,7 @@ void RenderWidgetHostViewQtDelegateWidget::unlockMouse() void RenderWidgetHostViewQtDelegateWidget::show() { + m_rootItem->setVisible(true); // Check if we're attached to a QWebEngineView, we don't // want to show anything else than popups as top-level. if (parent() || m_isPopup) { @@ -278,12 +279,12 @@ void RenderWidgetHostViewQtDelegateWidget::show() void RenderWidgetHostViewQtDelegateWidget::hide() { - QQuickWidget::hide(); + m_rootItem->setVisible(false); } bool RenderWidgetHostViewQtDelegateWidget::isVisible() const { - return QQuickWidget::isVisible(); + return QQuickWidget::isVisible() && m_rootItem->isVisible(); } QWindow* RenderWidgetHostViewQtDelegateWidget::window() const |