summaryrefslogtreecommitdiffstats
path: root/src/webengine
diff options
context:
space:
mode:
Diffstat (limited to 'src/webengine')
-rw-r--r--src/webengine/api/qquickwebenginedownloaditem.cpp1
-rw-r--r--src/webengine/api/qquickwebenginedownloaditem_p.h2
-rw-r--r--src/webengine/api/qquickwebengineprofile.cpp3
-rw-r--r--src/webengine/api/qquickwebenginescript.cpp2
-rw-r--r--src/webengine/api/qquickwebenginesettings.cpp2
-rw-r--r--src/webengine/api/qquickwebenginetestsupport_p.h1
-rw-r--r--src/webengine/api/qquickwebengineview.cpp9
-rw-r--r--src/webengine/api/qquickwebengineview_p_p.h1
-rw-r--r--src/webengine/api/qtwebengineglobal.cpp5
-rw-r--r--src/webengine/doc/src/qtwebengine-overview.qdoc44
-rw-r--r--src/webengine/doc/src/qtwebengine-platform-notes.qdoc10
-rw-r--r--src/webengine/doc/src/webengineview.qdoc42
-rw-r--r--src/webengine/render_widget_host_view_qt_delegate_quick.cpp13
13 files changed, 55 insertions, 80 deletions
diff --git a/src/webengine/api/qquickwebenginedownloaditem.cpp b/src/webengine/api/qquickwebenginedownloaditem.cpp
index ffbff95f0..c26255e3a 100644
--- a/src/webengine/api/qquickwebenginedownloaditem.cpp
+++ b/src/webengine/api/qquickwebenginedownloaditem.cpp
@@ -222,6 +222,7 @@ qint64 QQuickWebEngineDownloadItem::receivedBytes() const
/*!
\qmlproperty QString WebEngineDownloadItem::mimeType
+ \since QtWebEngine 1.2
Holds the MIME type of the download.
*/
diff --git a/src/webengine/api/qquickwebenginedownloaditem_p.h b/src/webengine/api/qquickwebenginedownloaditem_p.h
index c90e526c3..0b01fe6fc 100644
--- a/src/webengine/api/qquickwebenginedownloaditem_p.h
+++ b/src/webengine/api/qquickwebenginedownloaditem_p.h
@@ -108,7 +108,7 @@ Q_SIGNALS:
Q_REVISION(2) void savePageFormatChanged();
void receivedBytesChanged();
void totalBytesChanged();
- void mimeTypeChanged();
+ Q_REVISION(1) void mimeTypeChanged();
void pathChanged();
private:
diff --git a/src/webengine/api/qquickwebengineprofile.cpp b/src/webengine/api/qquickwebengineprofile.cpp
index b3ed5a62f..3873bc9c5 100644
--- a/src/webengine/api/qquickwebengineprofile.cpp
+++ b/src/webengine/api/qquickwebengineprofile.cpp
@@ -701,9 +701,10 @@ bool QQuickWebEngineProfile::isSpellCheckEnabled() const
return d->browserContext()->isSpellCheckEnabled();
}
#endif
+
/*!
- Returns the cookie store singleton, if one has been set.
+ Returns the cookie store for this profile.
*/
QWebEngineCookieStore *QQuickWebEngineProfile::cookieStore() const
{
diff --git a/src/webengine/api/qquickwebenginescript.cpp b/src/webengine/api/qquickwebenginescript.cpp
index 74bd9899a..8802a40f6 100644
--- a/src/webengine/api/qquickwebenginescript.cpp
+++ b/src/webengine/api/qquickwebenginescript.cpp
@@ -65,6 +65,8 @@ using QtWebEngineCore::UserScript;
not accessible from a different one. The worldId property provides some predefined IDs for this
purpose.
+ \note Chromium extensions, such as \c @include, \c @match, and \c @exclude, are not supported.
+
Use \l{WebEngineView::userScripts}{WebEngineView.userScripts} to access a list of scripts
attached to the web view.
*/
diff --git a/src/webengine/api/qquickwebenginesettings.cpp b/src/webengine/api/qquickwebenginesettings.cpp
index 56d4119cd..a5796c796 100644
--- a/src/webengine/api/qquickwebenginesettings.cpp
+++ b/src/webengine/api/qquickwebenginesettings.cpp
@@ -216,6 +216,8 @@ bool QQuickWebEngineSettings::errorPageEnabled() const
Enables support for Pepper plugins, such as the Flash player.
Disabled by default.
+
+ \sa {Pepper Plugin API Support}
*/
bool QQuickWebEngineSettings::pluginsEnabled() const
{
diff --git a/src/webengine/api/qquickwebenginetestsupport_p.h b/src/webengine/api/qquickwebenginetestsupport_p.h
index 374b4a97c..79d51e7a3 100644
--- a/src/webengine/api/qquickwebenginetestsupport_p.h
+++ b/src/webengine/api/qquickwebenginetestsupport_p.h
@@ -84,6 +84,7 @@ public:
Q_SIGNALS:
void validationMessageShown(const QString &mainText, const QString &subText);
void windowCloseRejected();
+ void loadVisuallyCommitted();
private:
QScopedPointer<QQuickWebEngineErrorPage> m_errorPage;
diff --git a/src/webengine/api/qquickwebengineview.cpp b/src/webengine/api/qquickwebengineview.cpp
index e2a5d07c3..99d6cc746 100644
--- a/src/webengine/api/qquickwebengineview.cpp
+++ b/src/webengine/api/qquickwebengineview.cpp
@@ -83,6 +83,8 @@
#include <QScreen>
#include <QUrl>
#include <QTimer>
+#include <private/qguiapplication_p.h>
+#include <qpa/qplatformintegration.h>
#ifndef QT_NO_ACCESSIBILITY
#include <private/qquickaccessibleattached_p.h>
#endif // QT_NO_ACCESSIBILITY
@@ -171,7 +173,7 @@ RenderWidgetHostViewQtDelegate *QQuickWebEngineViewPrivate::CreateRenderWidgetHo
RenderWidgetHostViewQtDelegate *QQuickWebEngineViewPrivate::CreateRenderWidgetHostViewQtDelegateForPopup(RenderWidgetHostViewQtDelegateClient *client)
{
Q_Q(QQuickWebEngineView);
- const bool hasWindowCapability = qApp->platformName().toLower() != QLatin1String("eglfs");
+ const bool hasWindowCapability = QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::MultipleWindows);
RenderWidgetHostViewQtDelegateQuick *quickDelegate = new RenderWidgetHostViewQtDelegateQuick(client, /*isPopup = */ true);
if (hasWindowCapability) {
RenderWidgetHostViewQtDelegateQuickWindow *wrapperWindow = new RenderWidgetHostViewQtDelegateQuickWindow(quickDelegate);
@@ -469,7 +471,10 @@ void QQuickWebEngineViewPrivate::loadCommitted()
void QQuickWebEngineViewPrivate::loadVisuallyCommitted()
{
- Q_EMIT e->loadVisuallyCommitted();
+#ifdef ENABLE_QML_TESTSUPPORT_API
+ if (m_testSupport)
+ Q_EMIT m_testSupport->loadVisuallyCommitted();
+#endif
}
Q_STATIC_ASSERT(static_cast<int>(WebEngineError::NoErrorDomain) == static_cast<int>(QQuickWebEngineView::NoErrorDomain));
diff --git a/src/webengine/api/qquickwebengineview_p_p.h b/src/webengine/api/qquickwebengineview_p_p.h
index 54de7c1b8..7f0dcc337 100644
--- a/src/webengine/api/qquickwebengineview_p_p.h
+++ b/src/webengine/api/qquickwebengineview_p_p.h
@@ -105,7 +105,6 @@ class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineViewExperimental : public QObjec
Q_SIGNALS:
void extraContextMenuEntriesComponentChanged();
- void loadVisuallyCommitted();
private:
QQuickWebEngineViewExperimental(QQuickWebEngineViewPrivate* viewPrivate);
diff --git a/src/webengine/api/qtwebengineglobal.cpp b/src/webengine/api/qtwebengineglobal.cpp
index 6cd13ad5f..801052782 100644
--- a/src/webengine/api/qtwebengineglobal.cpp
+++ b/src/webengine/api/qtwebengineglobal.cpp
@@ -65,8 +65,9 @@ namespace QtWebEngine {
Sets up an OpenGL Context that can be shared between processes. This has to be done after
QGuiApplication is created, but before a Qt Quick window is created.
- This has the same effect as passing Qt::AA_ShareOpenGLContexts to the QGuiApplication
- constructor.
+ This has the same effect as setting the Qt::AA_ShareOpenGLContexts
+ attribute with QCoreApplication::setAttribute before constructing
+ QGuiApplication.
*/
void initialize()
{
diff --git a/src/webengine/doc/src/qtwebengine-overview.qdoc b/src/webengine/doc/src/qtwebengine-overview.qdoc
index cf757a6d5..18c1f462d 100644
--- a/src/webengine/doc/src/qtwebengine-overview.qdoc
+++ b/src/webengine/doc/src/qtwebengine-overview.qdoc
@@ -121,11 +121,14 @@
created is not suitable for DOM operations, where one has to wait until the DOM is ready.
In addition, an injected script shares the same \e world as the other scripts executed on the
- page, which might lead to conflicts. To avoid this, the Chromium API for
- \e{Content Script Extensions} is implemented by \e {web engine script}. It specifies the
+ page, which might lead to conflicts. To avoid this, the QWebEngineScript class and the
+ WebEngineScript QML type provide implementations of the Chromium API for
+ \e{Content Script Extensions}. They specify the
script to run, the injection point, and the world where the script is run. This enables
accessing the DOM to manipulate it within a world.
+ \note Chromium extensions, such as \c @include, \c @match, and \c @exclude, are not supported.
+
Because the render process is separated from the GUI process, they should ideally share an
OpenGL context to enable one process to access the resources uploaded by the other, such as
images or textures. However, some inter-process communication is needed for safety and
@@ -152,7 +155,7 @@
Each QWebEnginePage belongs to a QWebEngineProfile that can have a QWebEngineSettings
for specifying page settings, a QWebEngineScriptCollection for running scripts on the page, and
a QWebEngineCookieStore for accessing the HTTP cookies of Chromium. A QWebEnginePage can also
- directly point to a script collection or cookie store.
+ directly point to a script collection.
\section1 Embedding Web Content into Qt Quick Applications
@@ -164,19 +167,9 @@
engine must be initialized by using \l QtWebEngine::initialize in the application main source
file, as illustrated by the following code snippet:
- \code
- int main(int argc, char **argv)
- {
- Application app(argc, argv);
-
- QtWebEngine::initialize();
-
- QQmlApplicationEngine appEngine;
- appEngine.load(QUrl("qrc:/main.qml"));
-
- return app.exec();
- }
- \endcode
+ \quotefromfile webengine/minimal/main.cpp
+ \skipto main
+ \printuntil }
An application can load pages into the WebEngineView, using either an URL or HTML string, and
navigate within session history. By default, links to different pages load within the same
@@ -186,22 +179,9 @@
The following sample QML application loads a web page using the \l{WebEngineView::}{url}
property:
- \qml
- import QtQuick 2.1
- import QtQuick.Controls 1.1
- import QtWebEngine 1.1
-
- ApplicationWindow {
- width: 1280
- height: 720
- visible: true
- WebEngineView {
- id: webview
- url: "http://www.qt.io"
- anchors.fill: parent
- }
- }
- \endqml
+ \quotefromfile webengine/minimal/main.qml
+ \skipto import
+ \printuntil /^\}/
\section1 Managing Certificates
diff --git a/src/webengine/doc/src/qtwebengine-platform-notes.qdoc b/src/webengine/doc/src/qtwebengine-platform-notes.qdoc
index 5a81c7775..c5f373029 100644
--- a/src/webengine/doc/src/qtwebengine-platform-notes.qdoc
+++ b/src/webengine/doc/src/qtwebengine-platform-notes.qdoc
@@ -68,8 +68,12 @@
\section1 Pepper Plugin API Support
- Qt WebEngine supports loading Pepper Plugin API (PPAPI) plugins. The plugins must be loaded
- manually using the Chromium command line syntax with the \c --register-pepper-plugins argument.
+ Qt WebEngine supports loading Pepper Plugin API (PPAPI) plugins if
+ WebEngineSettings::pluginsEnabled or QWebEngineSettings::PluginsEnabled
+ is set.
+
+ Except for the Adobe Flash Player plugin, the plugins must be loaded manually using the
+ Chromium command line syntax with the \c --register-pepper-plugins argument.
The argument value is a list of entries, separated by commas, that contain the file path and
one or several MIME types, separated by semicolons:
@@ -85,8 +89,6 @@
The MIME type is important because it determines which embeds the plugin is used for.
- This process has been automated for the Pepper Flash player plugin.
-
\section2 Pepper Flash Player Plugin Support
The Pepper Flash player plugin can be loaded automatically if it is installed in one of the
diff --git a/src/webengine/doc/src/webengineview.qdoc b/src/webengine/doc/src/webengineview.qdoc
index 79cb90aba..7b6c66e1e 100644
--- a/src/webengine/doc/src/webengineview.qdoc
+++ b/src/webengine/doc/src/webengineview.qdoc
@@ -40,19 +40,9 @@
\l QtWebEngine::initialize in the application main source file, as illustrated by the
following code snippet:
- \code
- int main(int argc, char **argv)
- {
- Application app(argc, argv);
-
- QtWebEngine::initialize();
-
- QQmlApplicationEngine appEngine;
- appEngine.load(QUrl("qrc:/main.qml"));
-
- return app.exec();
- }
- \endcode
+ \quotefromfile webengine/minimal/main.cpp
+ \skipto main
+ \printuntil }
\section2 Loading Web Pages
@@ -62,30 +52,16 @@
The following sample QML application loads a web page using the \c url property:
- \qml
- import QtQuick 2.1
- import QtQuick.Controls 1.1
- import QtWebEngine 1.1
-
- ApplicationWindow {
- width: 1280
- height: 720
- visible: true
- WebEngineView {
- id: webview
- url: "http://www.qt.io"
- anchors.fill: parent
- }
- }
- \endqml
+ \quotefromfile webengine/minimal/main.qml
+ \skipto import
+ \printuntil /^\}/
- The \l loadingChanged() signal is emitted when loading a page begins, ends, or fails. The
- \l loading property holds whether the HTML page is currently loading and the load status is
- reflected in the \l LoadStatus property.
+ The \l loading property holds whether an HTML page is currently loading.
+ The \l loadingChanged() signal is emitted when loading the page begins, ends, or fails.
The title of an HTML page can be accessed with the \l title property. Additionally, a web
page may specify an icon, which can be accessed using the \l icon property. The \l zoomFactor
- property holds the overall size of the contents of the web page.
+ property enables zooming the contents of the web page by a scale factor.
If a certificate error is raised while loading a web page, the \l certificateError() signal is
emitted. Certificate errors are handled by using the methods of the WebEngineCertificateError
diff --git a/src/webengine/render_widget_host_view_qt_delegate_quick.cpp b/src/webengine/render_widget_host_view_qt_delegate_quick.cpp
index 1101bd483..9ad86800c 100644
--- a/src/webengine/render_widget_host_view_qt_delegate_quick.cpp
+++ b/src/webengine/render_widget_host_view_qt_delegate_quick.cpp
@@ -66,14 +66,19 @@ RenderWidgetHostViewQtDelegateQuick::RenderWidgetHostViewQtDelegateQuick(RenderW
setActiveFocusOnTab(true);
#ifdef Q_OS_OSX
- // Check that the default QSurfaceFormat OpenGL profile matches the global OpenGL shared
- // context profile, otherwise this could lead to a nasty crash.
+ // Check that the default QSurfaceFormat OpenGL profile is compatible with the global OpenGL
+ // shared context profile, otherwise this could lead to a nasty crash.
QOpenGLContext *globalSharedContext = QOpenGLContext::globalShareContext();
if (globalSharedContext) {
QSurfaceFormat sharedFormat = globalSharedContext->format();
QSurfaceFormat defaultFormat = QSurfaceFormat::defaultFormat();
- if (defaultFormat.profile() != sharedFormat.profile()) {
- qFatal("QWebEngine: Default QSurfaceFormat OpenGL profile does not match global shared context OpenGL profile. Please make sure you set a new QSurfaceFormat before the QtGui application instance is created.");
+
+ if (defaultFormat.profile() != sharedFormat.profile()
+ && defaultFormat.profile() == QSurfaceFormat::CoreProfile
+ && defaultFormat.version() >= qMakePair(3, 2)) {
+ qFatal("QWebEngine: Default QSurfaceFormat OpenGL profile is not compatible with the "
+ "global shared context OpenGL profile. Please make sure you set a compatible "
+ "QSurfaceFormat before the QtGui application instance is created.");
}
}
#endif