summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--examples/webenginewidgets/demobrowser/tabwidget.cpp9
-rw-r--r--examples/webenginewidgets/simplebrowser/tabwidget.cpp2
-rw-r--r--src/core/core_module.pro8
-rw-r--r--src/core/media_capture_devices_dispatcher.cpp2
-rw-r--r--src/core/network_delegate_qt.cpp3
-rw-r--r--src/core/resources/resources.gyp26
-rw-r--r--src/core/url_request_context_getter_qt.cpp5
-rw-r--r--src/core/web_engine_context.cpp23
-rw-r--r--src/webengine/api/qquickwebenginesettings.cpp1
-rw-r--r--src/webengine/doc/src/qtwebengine-overview.qdoc18
10 files changed, 61 insertions, 36 deletions
diff --git a/examples/webenginewidgets/demobrowser/tabwidget.cpp b/examples/webenginewidgets/demobrowser/tabwidget.cpp
index 68d0c727c..3b56d115b 100644
--- a/examples/webenginewidgets/demobrowser/tabwidget.cpp
+++ b/examples/webenginewidgets/demobrowser/tabwidget.cpp
@@ -441,9 +441,12 @@ void TabWidget::fullScreenRequested(QWebEngineFullScreenRequest request)
WebView *oldWebView = this->webView(m_lineEdits->currentIndex());
webPage->setView(oldWebView);
request.accept();
- raise();
- m_fullScreenView->hide();
- m_fullScreenNotification->hide();
+ // Change the delete and window hide/show back to a simple m_fullScreenView->hide()
+ // once QTBUG-46701 gets fixed.
+ delete m_fullScreenView;
+ m_fullScreenView = 0;
+ window()->hide();
+ window()->show();
}
}
diff --git a/examples/webenginewidgets/simplebrowser/tabwidget.cpp b/examples/webenginewidgets/simplebrowser/tabwidget.cpp
index d9e0dea1b..3c6269f52 100644
--- a/examples/webenginewidgets/simplebrowser/tabwidget.cpp
+++ b/examples/webenginewidgets/simplebrowser/tabwidget.cpp
@@ -180,7 +180,7 @@ void TabWidget::setupView(WebView *webView)
connect(webView, &QWebEngineView::loadStarted, [this, webView]() {
int index = indexOf(webView);
if (index != -1) {
- QIcon icon(QLatin1String(":loading.gif"));
+ QIcon icon(QLatin1String(":view-refresh.png"));
setTabIcon(index, icon);
}
});
diff --git a/src/core/core_module.pro b/src/core/core_module.pro
index 6d2d11d40..fa402cc63 100644
--- a/src/core/core_module.pro
+++ b/src/core/core_module.pro
@@ -102,6 +102,14 @@ icu.files = $$OUT_PWD/$$getConfigDir()/icudtl.dat
resources2build.CONFIG = no_link no_clean target_predeps
QMAKE_EXTRA_COMPILERS += resources2build
+
+ locales2build.input = locales.files
+ locales2build.output = $$[QT_INSTALL_DATA/get]/translations/qtwebengine_locales/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT}
+ locales2build.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
+ locales2build.name = COPY ${QMAKE_FILE_IN}
+ locales2build.CONFIG = no_link no_clean target_predeps
+
+ QMAKE_EXTRA_COMPILERS += locales2build
}
}
diff --git a/src/core/media_capture_devices_dispatcher.cpp b/src/core/media_capture_devices_dispatcher.cpp
index 4d1e8b200..4d11277b0 100644
--- a/src/core/media_capture_devices_dispatcher.cpp
+++ b/src/core/media_capture_devices_dispatcher.cpp
@@ -63,6 +63,8 @@
#include "media/audio/audio_manager_base.h"
#include "ui/base/l10n/l10n_util.h"
+#include <QtCore/qcoreapplication.h>
+
namespace QtWebEngineCore {
using content::BrowserThread;
diff --git a/src/core/network_delegate_qt.cpp b/src/core/network_delegate_qt.cpp
index cb2a9dc58..b1a2faf8d 100644
--- a/src/core/network_delegate_qt.cpp
+++ b/src/core/network_delegate_qt.cpp
@@ -125,7 +125,8 @@ int NetworkDelegateQt::OnBeforeURLRequest(net::URLRequest *request, const net::C
request->SetExtraRequestHeaderByName(header.key().toStdString(), header.value().toStdString(), /* overwrite */ true);
}
- return result;
+ if (result != net::OK)
+ return result;
}
}
diff --git a/src/core/resources/resources.gyp b/src/core/resources/resources.gyp
index 4226b7561..88c5bb4be 100644
--- a/src/core/resources/resources.gyp
+++ b/src/core/resources/resources.gyp
@@ -87,32 +87,6 @@
'includes': [ 'repack_locales.gypi' ],
},
],
- 'conditions': [
- ['qt_install_data != ""', {
- 'copies': [
- {
- 'destination': '<(qt_install_data)/resources',
- 'files': [ '<(SHARED_INTERMEDIATE_DIR)/repack/qtwebengine_resources.pak' ],
- },
- {
- 'destination': '<(qt_install_data)/resources',
- 'files': [ '<(SHARED_INTERMEDIATE_DIR)/repack/qtwebengine_resources_100p.pak' ],
- },
- {
- 'destination': '<(qt_install_data)/resources',
- 'files': [ '<(SHARED_INTERMEDIATE_DIR)/repack/qtwebengine_resources_200p.pak' ],
- },
- ],
- }],
- ['qt_install_translations != ""', {
- 'copies': [
- {
- 'destination': '<(qt_install_translations)/qtwebengine_locales',
- 'files': [ '<@(locale_files)' ],
- },
- ],
- }],
- ],
}
]
}
diff --git a/src/core/url_request_context_getter_qt.cpp b/src/core/url_request_context_getter_qt.cpp
index ca79b55d4..f80aa194b 100644
--- a/src/core/url_request_context_getter_qt.cpp
+++ b/src/core/url_request_context_getter_qt.cpp
@@ -157,8 +157,11 @@ void URLRequestContextGetterQt::generateStorage()
Q_ASSERT(m_urlRequestContext);
// We must stop all requests before deleting their backends.
- if (m_storage)
+ if (m_storage) {
cancelAllUrlRequests();
+ // we need to get rid of dangling pointer due to coming storage deletion
+ m_urlRequestContext->set_http_transaction_factory(0);
+ }
m_storage.reset(new net::URLRequestContextStorage(m_urlRequestContext.get()));
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index bf7b29435..b3bfc432b 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -113,7 +113,9 @@ void destroyContext()
bool usingANGLE()
{
#if defined(Q_OS_WIN)
- return qt_gl_global_share_context()->isOpenGLES();
+ if (qt_gl_global_share_context())
+ return qt_gl_global_share_context()->isOpenGLES();
+ return QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGLES;
#else
return false;
#endif
@@ -296,10 +298,23 @@ WebEngineContext::WebEngineContext()
parsedCommandLine->AppendSwitch(switches::kDisableGpu);
} else {
const char *glType = 0;
- if (qt_gl_global_share_context()->isOpenGLES()) {
- glType = gfx::kGLImplementationEGLName;
+ if (qt_gl_global_share_context()) {
+ if (qt_gl_global_share_context()->isOpenGLES()) {
+ glType = gfx::kGLImplementationEGLName;
+ } else {
+ glType = gfx::kGLImplementationDesktopName;
+ }
} else {
- glType = gfx::kGLImplementationDesktopName;
+ qWarning("WebEngineContext used before QtWebEngine::initialize()");
+ // We have to assume the default OpenGL module type will be used.
+ switch (QOpenGLContext::openGLModuleType()) {
+ case QOpenGLContext::LibGL:
+ glType = gfx::kGLImplementationDesktopName;
+ break;
+ case QOpenGLContext::LibGLES:
+ glType = gfx::kGLImplementationEGLName;
+ break;
+ }
}
parsedCommandLine->AppendSwitchASCII(switches::kUseGL, glType);
diff --git a/src/webengine/api/qquickwebenginesettings.cpp b/src/webengine/api/qquickwebenginesettings.cpp
index a5796c796..73d3e34b9 100644
--- a/src/webengine/api/qquickwebenginesettings.cpp
+++ b/src/webengine/api/qquickwebenginesettings.cpp
@@ -318,6 +318,7 @@ bool QQuickWebEngineSettings::touchIconsEnabled() const
/*!
\qmlproperty QString WebEngineSettings::defaultTextEncoding
+ \since QtWebEngine 1.2
Sets the default encoding. The value must be a string describing an encoding such as "utf-8" or
"iso-8859-1".
diff --git a/src/webengine/doc/src/qtwebengine-overview.qdoc b/src/webengine/doc/src/qtwebengine-overview.qdoc
index 18c1f462d..eae16c5e5 100644
--- a/src/webengine/doc/src/qtwebengine-overview.qdoc
+++ b/src/webengine/doc/src/qtwebengine-overview.qdoc
@@ -157,6 +157,24 @@
a QWebEngineCookieStore for accessing the HTTP cookies of Chromium. A QWebEnginePage can also
directly point to a script collection.
+ For a widget based application, the web engine is automatically initialized, unless it is
+ placed in a plugin. In that case, it must be initialized in the application main source file
+ by using \l QtWebEngine::initialize, as illustrated by the following code snippet:
+
+ \code
+ int main(int argc, char **argv)
+ {
+ QApplication app(argc, argv);
+
+ QtWebEngine::initialize();
+
+ QMainWindow window;
+ window.show();
+
+ return app.exec();
+ }
+ \endcode
+
\section1 Embedding Web Content into Qt Quick Applications
The WebEngineView QML type allows Qt Quick applications to render regions of dynamic web