From 42d8036576c340e9d4cca45361c448f184957aa6 Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Tue, 5 Feb 2019 13:54:04 +0100 Subject: Try using authentication from QNetworkProxy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use credentials for QNetworkProxy if set. Done-With: Allan Sandfeld Jensen Task-number: QTBUG-58121 Change-Id: I9c7328af90f3c60144c5ecf385529f663f0e46b2 Reviewed-by: Michael Brüning --- src/webengine/doc/src/qtwebengine-overview.qdoc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/webengine') diff --git a/src/webengine/doc/src/qtwebengine-overview.qdoc b/src/webengine/doc/src/qtwebengine-overview.qdoc index bd5569e3f..4ac5108b1 100644 --- a/src/webengine/doc/src/qtwebengine-overview.qdoc +++ b/src/webengine/doc/src/qtwebengine-overview.qdoc @@ -228,14 +228,18 @@ are automatically retrieved from the system. Settings from an installed QNetworkProxyFactory will be ignored, though. - Not all properties of QNetworkProxy are supported by Qt WebEngine. That is, - QNetworkProxy::type(), QNetworkProxy::hostName() and QNetworkProxy::port() are taken into - account. All other proxy settings such as QNetworkProxy::rawHeader(), QNetworkProxy::user(), or - QNetworkProxy::password() are ignored. + In case QNetworkProxy::user() and QNetworkProxy::password() are set, these credentials + will be automatically used for proxy authentication. It is up to the user to provide valid + credentials, since there is no error handling callback. - If a proxy requires authentication, QWebEnginePage::proxyAuthenticationRequired is emitted. + If no credentials are set with QNetworkProxy, but the proxy requires authentication, + QWebEnginePage::proxyAuthenticationRequired is emitted. For Qt Quick, a dialog is shown. + Not all properties of QNetworkProxy are supported by Qt WebEngine. That is, + QNetworkProxy::type(), QNetworkProxy::hostName() and QNetworkProxy::port() are taken into + account. All other proxy settings such as QNetworkProxy::rawHeader() are ignored. + \section1 High DPI Support To support High DPI devices, it is recommended that the application attribute -- cgit v1.2.3 From c8dcc8cffa82c482734bcafce64496840c1e4988 Mon Sep 17 00:00:00 2001 From: Kirill Burtsev Date: Tue, 5 Feb 2019 15:48:13 +0100 Subject: Doc: Fix type of WebEngineDownloadItem::view property MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I46fc228d99ad6d89d6f2a79a7f3c3352befe0a64 Reviewed-by: Leena Miettinen Reviewed-by: Jüri Valdmann --- src/webengine/api/qquickwebenginedownloaditem.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/webengine') diff --git a/src/webengine/api/qquickwebenginedownloaditem.cpp b/src/webengine/api/qquickwebenginedownloaditem.cpp index a80f163d5..b69e6b7da 100644 --- a/src/webengine/api/qquickwebenginedownloaditem.cpp +++ b/src/webengine/api/qquickwebenginedownloaditem.cpp @@ -593,12 +593,14 @@ bool QQuickWebEngineDownloadItem::isPaused() const } /*! - \qmlproperty bool WebEngineDownloadItem::view + \qmlproperty WebEngineView WebEngineDownloadItem::view \readonly \since QtWebEngine 1.8 Returns the view the download was requested on. If the download was not triggered by content in a view, \c nullptr is returned. + + \sa WebEngineView */ QQuickWebEngineView *QQuickWebEngineDownloadItem::view() const { -- cgit v1.2.3 From 755f7e414583c5458c2d421d047a1c7890c8d8d2 Mon Sep 17 00:00:00 2001 From: Kirill Burtsev Date: Mon, 11 Feb 2019 19:13:01 +0100 Subject: Set download state to finished when cancelling or destroying the download item MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTBUG-73839 Change-Id: Ieebaa802bdfe0c410618e4213a9bedbbae9d0f61 Reviewed-by: Michael Brüning Reviewed-by: Jüri Valdmann --- src/webengine/api/qquickwebenginedownloaditem.cpp | 20 ++++++++++++++++---- src/webengine/api/qquickwebenginedownloaditem_p_p.h | 1 + 2 files changed, 17 insertions(+), 4 deletions(-) (limited to 'src/webengine') diff --git a/src/webengine/api/qquickwebenginedownloaditem.cpp b/src/webengine/api/qquickwebenginedownloaditem.cpp index b69e6b7da..7d1382876 100644 --- a/src/webengine/api/qquickwebenginedownloaditem.cpp +++ b/src/webengine/api/qquickwebenginedownloaditem.cpp @@ -185,10 +185,8 @@ void QQuickWebEngineDownloadItemPrivate::update(const ProfileAdapterClient::Down Q_EMIT q->totalBytesChanged(); } - if (info.done != downloadFinished) { - downloadFinished = info.done; - Q_EMIT q->isFinishedChanged(); - } + if (info.done) + setFinished(); if (info.paused != downloadPaused) { downloadPaused = info.paused; @@ -206,6 +204,17 @@ void QQuickWebEngineDownloadItemPrivate::updateState(QQuickWebEngineDownloadItem } } +void QQuickWebEngineDownloadItemPrivate::setFinished() +{ + Q_Q(QQuickWebEngineDownloadItem); + + if (downloadFinished) + return; + + downloadFinished = true; + Q_EMIT q->isFinishedChanged(); +} + /*! \qmlmethod void WebEngineDownloadItem::accept() @@ -255,6 +264,7 @@ void QQuickWebEngineDownloadItem::cancel() return; d->updateState(QQuickWebEngineDownloadItem::DownloadCancelled); + d->setFinished(); // We directly cancel the download if the user cancels before // it even started, so no need to notify the profile here. @@ -617,6 +627,8 @@ QQuickWebEngineDownloadItem::QQuickWebEngineDownloadItem(QQuickWebEngineDownload QQuickWebEngineDownloadItem::~QQuickWebEngineDownloadItem() { + if (!isFinished()) + cancel(); if (d_ptr->profile) d_ptr->profile->d_ptr->profileAdapter()->removeDownload(d_ptr->downloadId); } diff --git a/src/webengine/api/qquickwebenginedownloaditem_p_p.h b/src/webengine/api/qquickwebenginedownloaditem_p_p.h index 4b89335bd..f444c04a5 100644 --- a/src/webengine/api/qquickwebenginedownloaditem_p_p.h +++ b/src/webengine/api/qquickwebenginedownloaditem_p_p.h @@ -85,6 +85,7 @@ public: void update(const QtWebEngineCore::ProfileAdapterClient::DownloadItemInfo &info); void updateState(QQuickWebEngineDownloadItem::DownloadState newState); + void setFinished(); }; QT_END_NAMESPACE -- cgit v1.2.3 From 7537526093c92e89672d1e952a9baceecaa91730 Mon Sep 17 00:00:00 2001 From: Kirill Burtsev Date: Mon, 11 Feb 2019 19:21:03 +0100 Subject: Remove download properly on profile destruction to avoid use after free MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In the Widgets API, download items are children of the profile and are destroyed when the parent profile destroys its children. The download item's destructor can therefore not access the profile, as it would cause a heap-use-after-free crashes. On quick side turn ongoing downloads cleanup to match widgets one. Fixes: QTBUG-73839 Change-Id: Iabb379e91187e3e68ebcd4693fec35883b72b1f2 Reviewed-by: Michael Brüning Reviewed-by: Jüri Valdmann --- src/webengine/api/qquickwebenginedownloaditem.cpp | 2 -- src/webengine/api/qquickwebengineprofile.cpp | 28 +++++++++++++++-------- src/webengine/api/qquickwebengineprofile_p.h | 4 +++- 3 files changed, 22 insertions(+), 12 deletions(-) (limited to 'src/webengine') diff --git a/src/webengine/api/qquickwebenginedownloaditem.cpp b/src/webengine/api/qquickwebenginedownloaditem.cpp index 7d1382876..981d11633 100644 --- a/src/webengine/api/qquickwebenginedownloaditem.cpp +++ b/src/webengine/api/qquickwebenginedownloaditem.cpp @@ -629,8 +629,6 @@ QQuickWebEngineDownloadItem::~QQuickWebEngineDownloadItem() { if (!isFinished()) cancel(); - if (d_ptr->profile) - d_ptr->profile->d_ptr->profileAdapter()->removeDownload(d_ptr->downloadId); } QT_END_NAMESPACE diff --git a/src/webengine/api/qquickwebengineprofile.cpp b/src/webengine/api/qquickwebengineprofile.cpp index ddc71602b..26fcf28f7 100644 --- a/src/webengine/api/qquickwebengineprofile.cpp +++ b/src/webengine/api/qquickwebengineprofile.cpp @@ -175,13 +175,6 @@ QQuickWebEngineProfilePrivate::~QQuickWebEngineProfilePrivate() m_profileAdapter->removeClient(this); } - for (QQuickWebEngineDownloadItem *download : qAsConst(m_ongoingDownloads)) { - if (download) - download->cancel(); - } - - m_ongoingDownloads.clear(); - if (m_profileAdapter != QtWebEngineCore::ProfileAdapter::defaultProfileAdapter()) delete m_profileAdapter; } @@ -215,6 +208,23 @@ void QQuickWebEngineProfilePrivate::cancelDownload(quint32 downloadId) void QQuickWebEngineProfilePrivate::downloadDestroyed(quint32 downloadId) { m_ongoingDownloads.remove(downloadId); + if (m_profileAdapter) + m_profileAdapter->removeDownload(downloadId); +} + +void QQuickWebEngineProfilePrivate::cleanDownloads() +{ + for (auto download : m_ongoingDownloads.values()) { + if (!download) + continue; + + if (!download->isFinished()) + download->cancel(); + + if (m_profileAdapter) + m_profileAdapter->removeDownload(download->id()); + } + m_ongoingDownloads.clear(); } void QQuickWebEngineProfilePrivate::downloadRequested(DownloadItemInfo &info) @@ -239,6 +249,7 @@ void QQuickWebEngineProfilePrivate::downloadRequested(DownloadItemInfo &info) QQuickWebEngineDownloadItem *download = new QQuickWebEngineDownloadItem(itemPrivate, q); m_ongoingDownloads.insert(info.id, download); + QObject::connect(download, &QQuickWebEngineDownloadItem::destroyed, q, [id = info.id, this] () { downloadDestroyed(id); }); QQmlEngine::setObjectOwnership(download, QQmlEngine::JavaScriptOwnership); Q_EMIT q->downloadRequested(download); @@ -252,7 +263,6 @@ void QQuickWebEngineProfilePrivate::downloadRequested(DownloadItemInfo &info) if (state == QQuickWebEngineDownloadItem::DownloadRequested) { // Delete unaccepted downloads. info.accepted = false; - m_ongoingDownloads.remove(info.id); delete download; } } @@ -275,7 +285,6 @@ void QQuickWebEngineProfilePrivate::downloadUpdated(const DownloadItemInfo &info if (info.state != ProfileAdapterClient::DownloadInProgress) { Q_EMIT q->downloadFinished(download); - m_ongoingDownloads.remove(info.id); } } @@ -380,6 +389,7 @@ QQuickWebEngineProfile::QQuickWebEngineProfile(QQuickWebEngineProfilePrivate *pr */ QQuickWebEngineProfile::~QQuickWebEngineProfile() { + d_ptr->cleanDownloads(); } /*! diff --git a/src/webengine/api/qquickwebengineprofile_p.h b/src/webengine/api/qquickwebengineprofile_p.h index d31ded0ec..2b1a5b134 100644 --- a/src/webengine/api/qquickwebengineprofile_p.h +++ b/src/webengine/api/qquickwebengineprofile_p.h @@ -53,7 +53,7 @@ #include "profile_adapter_client.h" #include "profile_adapter.h" -#include "qquickwebengineprofile_p.h" +#include "qquickwebengineprofile.h" #include #include @@ -80,6 +80,8 @@ public: void cancelDownload(quint32 downloadId); void downloadDestroyed(quint32 downloadId); + void cleanDownloads(); + void downloadRequested(DownloadItemInfo &info) override; void downloadUpdated(const DownloadItemInfo &info) override; -- cgit v1.2.3 From f5bad87426599ff52e382aa7e0698a7e4b4b62de Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Thu, 21 Feb 2019 16:08:37 +0100 Subject: Doc: Copy minimal example code into overview page After change cfe53bce9, the 'minimal' example isn't that minimal anymore. Rather copy the few lines, like we already do for the widget example. Change-Id: I9dd818738edb8d229f54ff24822d4c1723376ccc Reviewed-by: Leena Miettinen --- src/webengine/doc/src/qtwebengine-overview.qdoc | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src/webengine') diff --git a/src/webengine/doc/src/qtwebengine-overview.qdoc b/src/webengine/doc/src/qtwebengine-overview.qdoc index bd5569e3f..d83a65bdb 100644 --- a/src/webengine/doc/src/qtwebengine-overview.qdoc +++ b/src/webengine/doc/src/qtwebengine-overview.qdoc @@ -149,9 +149,19 @@ engine must be initialized by using \l QtWebEngine::initialize in the application main source file, as illustrated by the following code snippet: - \quotefromfile webengine/minimal/main.cpp - \skipto main - \printuntil } + \code + int main(int argc, char *argv[]) + { + QGuiApplication app(argc, argv); + + QtWebEngine::initialize(); + + QQmlApplicationEngine engine; + engine.load(QUrl("qrc:/main.qml")); + + return app.exec(); + } + \endcode 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 -- cgit v1.2.3 From 9d362e9d5fabf243c7a326073dd376ffa7aab3f5 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Tue, 19 Feb 2019 15:33:40 +0100 Subject: Revision WebEngineProfile::userNotification Change-Id: I6a5ff72c91cb1b173ca140efe3d4c95036f945eb Reviewed-by: Allan Sandfeld Jensen --- src/webengine/api/qquickwebengineprofile.cpp | 1 + src/webengine/api/qquickwebengineprofile.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'src/webengine') diff --git a/src/webengine/api/qquickwebengineprofile.cpp b/src/webengine/api/qquickwebengineprofile.cpp index cf9dae90a..edd460f3a 100644 --- a/src/webengine/api/qquickwebengineprofile.cpp +++ b/src/webengine/api/qquickwebengineprofile.cpp @@ -382,6 +382,7 @@ void QQuickWebEngineProfilePrivate::userScripts_clear(QQmlListProperty Date: Thu, 21 Feb 2019 15:56:05 +0100 Subject: Doc: Bump QtWebEngine import to 1.9 Change-Id: I3728a4d0bb41412cd5059a63633ad383b2a378ea Reviewed-by: Leena Miettinen --- src/webengine/doc/src/qtwebengine-qmlmodule.qdoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/webengine') diff --git a/src/webengine/doc/src/qtwebengine-qmlmodule.qdoc b/src/webengine/doc/src/qtwebengine-qmlmodule.qdoc index 17c29a126..51e0613dc 100644 --- a/src/webengine/doc/src/qtwebengine-qmlmodule.qdoc +++ b/src/webengine/doc/src/qtwebengine-qmlmodule.qdoc @@ -26,7 +26,7 @@ ****************************************************************************/ /*! - \qmlmodule QtWebEngine 1.8 + \qmlmodule QtWebEngine 1.9 \title Qt WebEngine QML Types \brief Provides QML types for rendering web content within a QML application \ingroup qtwebengine-modules @@ -36,7 +36,7 @@ your .qml file: \badcode - import QtWebEngine 1.8 + import QtWebEngine 1.9 \endcode To link against the module, add the following QT variable to your qmake .pro -- cgit v1.2.3 From 598bfc652edffb047948e01c3c76eb9e0cb7db4e Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Thu, 21 Feb 2019 17:01:03 +0100 Subject: Doc: Always treat \brief as full sentence Make sure all \brief descriptions start with an upper-case letter and end with a . Also start descriptions of \class with the name of the class or struct. Change-Id: Ifd2656201f9c1dff092085508a5423ce516e2d3f Reviewed-by: Leena Miettinen --- src/webengine/api/qquickwebengineprofile.cpp | 2 +- src/webengine/api/qquickwebengineview.cpp | 2 +- src/webengine/doc/src/qtwebengine-examples.qdoc | 2 +- src/webengine/doc/src/qtwebengine-qmlmodule.qdoc | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/webengine') diff --git a/src/webengine/api/qquickwebengineprofile.cpp b/src/webengine/api/qquickwebengineprofile.cpp index 26fcf28f7..b7abb13fc 100644 --- a/src/webengine/api/qquickwebengineprofile.cpp +++ b/src/webengine/api/qquickwebengineprofile.cpp @@ -958,7 +958,7 @@ QQuickWebEngineSettings *QQuickWebEngineProfile::settings() const \property QQuickWebEngineProfile::userScripts \since 5.9 - \brief the collection of scripts that are injected into all pages that share + \brief The collection of scripts that are injected into all pages that share this profile. \sa QQuickWebEngineScript, QQmlListReference diff --git a/src/webengine/api/qquickwebengineview.cpp b/src/webengine/api/qquickwebengineview.cpp index b9ae06aeb..35f797cb1 100644 --- a/src/webengine/api/qquickwebengineview.cpp +++ b/src/webengine/api/qquickwebengineview.cpp @@ -1277,7 +1277,7 @@ void QQuickWebEngineView::setBackgroundColor(const QColor &color) /*! \property QQuickWebEngineView::audioMuted - \brief the state of whether the current page audio is muted. + \brief The state of whether the current page audio is muted. \since 5.7 The default value is false. diff --git a/src/webengine/doc/src/qtwebengine-examples.qdoc b/src/webengine/doc/src/qtwebengine-examples.qdoc index 1f1780764..24604e3dd 100644 --- a/src/webengine/doc/src/qtwebengine-examples.qdoc +++ b/src/webengine/doc/src/qtwebengine-examples.qdoc @@ -28,7 +28,7 @@ /*! \group webengine-examples \title Qt WebEngine Examples - \brief Examples demonstrating the Qt WebEngine usage + \brief Examples demonstrating the Qt WebEngine usage. \ingroup all-examples These examples and demonstrations show a range of different uses for \l{Qt WebEngine}, diff --git a/src/webengine/doc/src/qtwebengine-qmlmodule.qdoc b/src/webengine/doc/src/qtwebengine-qmlmodule.qdoc index 17c29a126..5e172087d 100644 --- a/src/webengine/doc/src/qtwebengine-qmlmodule.qdoc +++ b/src/webengine/doc/src/qtwebengine-qmlmodule.qdoc @@ -28,7 +28,7 @@ /*! \qmlmodule QtWebEngine 1.8 \title Qt WebEngine QML Types - \brief Provides QML types for rendering web content within a QML application + \brief Provides QML types for rendering web content within a QML application. \ingroup qtwebengine-modules \ingroup qmlmodules -- cgit v1.2.3 From d2ff59ffb4967eb34a04133ce9090da9499d4ff1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Br=C3=BCning?= Date: Mon, 18 Feb 2019 17:56:56 +0100 Subject: Add a setting to control if the PDF viewer is enabled [ChangeLog] Introduces a setting to control if the internal PDF viewer is enabled. By default, PDF documents will now be opened in the viewer instead of being downloaded. Change-Id: I78b3b3702ae3be3da58c9635720ba861db3de661 Reviewed-by: Leena Miettinen Reviewed-by: Michal Klocek --- src/webengine/api/qquickwebenginesettings.cpp | 22 ++++++++++++++++++++++ src/webengine/api/qquickwebenginesettings_p.h | 4 ++++ 2 files changed, 26 insertions(+) (limited to 'src/webengine') diff --git a/src/webengine/api/qquickwebenginesettings.cpp b/src/webengine/api/qquickwebenginesettings.cpp index 6e96e76cf..4f6a8c148 100644 --- a/src/webengine/api/qquickwebenginesettings.cpp +++ b/src/webengine/api/qquickwebenginesettings.cpp @@ -456,6 +456,20 @@ bool QQuickWebEngineSettings::dnsPrefetchEnabled() const return d_ptr->testAttribute(WebEngineSettings::DnsPrefetchEnabled); } +/*! + \qmlproperty bool WebEngineSettings::pdfViewerEnabled + \since QtWebEngine 1.9 + + Specifies that PDF documents will be opened in the internal PDF viewer + instead of being downloaded. + + Enabled by default. +*/ +bool QQuickWebEngineSettings::pdfViewerEnabled() const +{ + return d_ptr->testAttribute(WebEngineSettings::PDFViewerEnabled); +} + /*! \qmlproperty string WebEngineSettings::defaultTextEncoding \since QtWebEngine 1.2 @@ -714,6 +728,14 @@ void QQuickWebEngineSettings::setDnsPrefetchEnabled(bool on) Q_EMIT dnsPrefetchEnabledChanged(); } +void QQuickWebEngineSettings::setPDFViewerEnabled(bool on) +{ + bool wasOn = d_ptr->testAttribute(WebEngineSettings::PDFViewerEnabled); + d_ptr->setAttribute(WebEngineSettings::PDFViewerEnabled, on); + if (wasOn != on) + Q_EMIT pdfViewerEnabledChanged(); +} + void QQuickWebEngineSettings::setUnknownUrlSchemePolicy(QQuickWebEngineSettings::UnknownUrlSchemePolicy policy) { WebEngineSettings::UnknownUrlSchemePolicy oldPolicy = d_ptr->unknownUrlSchemePolicy(); diff --git a/src/webengine/api/qquickwebenginesettings_p.h b/src/webengine/api/qquickwebenginesettings_p.h index 6e1aaca39..ae6703bd2 100644 --- a/src/webengine/api/qquickwebenginesettings_p.h +++ b/src/webengine/api/qquickwebenginesettings_p.h @@ -93,6 +93,7 @@ class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineSettings : public QObject { Q_PROPERTY(bool webRTCPublicInterfacesOnly READ webRTCPublicInterfacesOnly WRITE setWebRTCPublicInterfacesOnly NOTIFY webRTCPublicInterfacesOnlyChanged REVISION 6 FINAL) Q_PROPERTY(bool javascriptCanPaste READ javascriptCanPaste WRITE setJavascriptCanPaste NOTIFY javascriptCanPasteChanged REVISION 6 FINAL) Q_PROPERTY(bool dnsPrefetchEnabled READ dnsPrefetchEnabled WRITE setDnsPrefetchEnabled NOTIFY dnsPrefetchEnabledChanged REVISION 7 FINAL) + Q_PROPERTY(bool pdfViewerEnabled READ pdfViewerEnabled WRITE setPDFViewerEnabled NOTIFY pdfViewerEnabledChanged REVISION 8 FINAL) public: enum UnknownUrlSchemePolicy { @@ -135,6 +136,7 @@ public: bool webRTCPublicInterfacesOnly() const; bool javascriptCanPaste() const; bool dnsPrefetchEnabled() const; + bool pdfViewerEnabled() const; void setAutoLoadImages(bool on); void setJavascriptEnabled(bool on); @@ -166,6 +168,7 @@ public: void setWebRTCPublicInterfacesOnly(bool on); void setJavascriptCanPaste(bool on); void setDnsPrefetchEnabled(bool on); + void setPDFViewerEnabled(bool on); signals: void autoLoadImagesChanged(); @@ -198,6 +201,7 @@ signals: Q_REVISION(6) void webRTCPublicInterfacesOnlyChanged(); Q_REVISION(6) void javascriptCanPasteChanged(); Q_REVISION(7) void dnsPrefetchEnabledChanged(); + Q_REVISION(8) void pdfViewerEnabledChanged(); private: explicit QQuickWebEngineSettings(QQuickWebEngineSettings *parentSettings = 0); -- cgit v1.2.3 From 4714ca1b14fdf889cc2df8fef0d6eb0f436c2eae Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Tue, 19 Feb 2019 15:27:27 +0100 Subject: Update plugins.qmltypes for Qt 5.13 Task-number: QTBUG-73484 Change-Id: I9e8fb525e7dc77b46cff654b9c4b7a52b76cd45d Reviewed-by: Allan Sandfeld Jensen --- src/webengine/plugin/plugin.pro | 1 + src/webengine/plugin/plugins.qmltypes | 85 ++++++++++++++++++++++++++++++++++- 2 files changed, 84 insertions(+), 2 deletions(-) (limited to 'src/webengine') diff --git a/src/webengine/plugin/plugin.pro b/src/webengine/plugin/plugin.pro index 102f9a9fe..0c1310de3 100644 --- a/src/webengine/plugin/plugin.pro +++ b/src/webengine/plugin/plugin.pro @@ -8,4 +8,5 @@ QT_PRIVATE += core-private webenginecore-private webengine-private SOURCES = plugin.cpp +QMAKE_QMLPLUGINDUMP_FLAGS = -defaultplatform load(qml_plugin) diff --git a/src/webengine/plugin/plugins.qmltypes b/src/webengine/plugin/plugins.qmltypes index 435124e30..74c710e8b 100644 --- a/src/webengine/plugin/plugins.qmltypes +++ b/src/webengine/plugin/plugins.qmltypes @@ -4,7 +4,7 @@ import QtQuick.tooling 1.2 // It is used for QML tooling purposes only. // // This file was auto-generated by: -// 'qmlplugindump -defaultplatform -dependencies dependencies.json -nonrelocatable QtWebEngine 1.9' +// 'qmlplugindump -nonrelocatable -defaultplatform -dependencies dependencies.json QtWebEngine 1.9' Module { dependencies: ["QtQuick 2.8"] @@ -79,6 +79,46 @@ Module { Method { name: "ignoreCertificateError" } Method { name: "rejectCertificate" } } + Component { + name: "QQuickWebEngineClientCertificateOption" + prototype: "QObject" + exports: ["QtWebEngine/WebEngineClientCertificateOption 1.9"] + isCreatable: false + exportMetaObjectRevisions: [0] + Property { name: "issuer"; type: "string"; isReadonly: true } + Property { name: "subject"; type: "string"; isReadonly: true } + Property { name: "effectiveDate"; type: "QDateTime"; isReadonly: true } + Property { name: "expiryDate"; type: "QDateTime"; isReadonly: true } + Property { name: "isSelfSigned"; type: "bool"; isReadonly: true } + Method { name: "select" } + } + Component { + name: "QQuickWebEngineClientCertificateSelection" + prototype: "QObject" + exports: ["QtWebEngine/WebEngineClientCertificateSelection 1.9"] + isCreatable: false + exportMetaObjectRevisions: [0] + Property { name: "host"; type: "QUrl"; isReadonly: true } + Property { + name: "certificates" + type: "QQuickWebEngineClientCertificateOption" + isList: true + isReadonly: true + } + Method { + name: "select" + Parameter { name: "idx"; type: "int" } + } + Method { + name: "select" + Parameter { + name: "certificate" + type: "const QQuickWebEngineClientCertificateOption" + isPointer: true + } + } + Method { name: "selectNone" } + } Component { name: "QQuickWebEngineColorDialogRequest" prototype: "QObject" @@ -490,6 +530,11 @@ Module { name: "downloadFinished" Parameter { name: "download"; type: "QQuickWebEngineDownloadItem"; isPointer: true } } + Signal { + name: "userNotification" + revision: 6 + Parameter { name: "notification"; type: "QWebEngineNotification"; isPointer: true } + } Method { name: "clearHttpCache"; revision: 2 } } Component { @@ -729,7 +774,8 @@ Module { "MediaAudioVideoCapture": 2, "Geolocation": 3, "DesktopVideoCapture": 4, - "DesktopAudioVideoCapture": 5 + "DesktopAudioVideoCapture": 5, + "Notifications": 6 } } Enum { @@ -1137,6 +1183,15 @@ Module { Parameter { name: "request"; type: "QWebEngineRegisterProtocolHandlerRequest" } } Signal { name: "printRequested"; revision: 8 } + Signal { + name: "selectClientCertificate" + revision: 9 + Parameter { + name: "clientCertSelection" + type: "QQuickWebEngineClientCertificateSelection" + isPointer: true + } + } Method { name: "runJavaScript" Parameter { type: "string" } @@ -1262,6 +1317,32 @@ Module { Parameter { name: "action"; type: "WebAction" } } } + Component { + name: "QWebEngineNotification" + prototype: "QObject" + exports: ["QtWebEngine/WebEngineNotification 1.9"] + isCreatable: false + exportMetaObjectRevisions: [0] + Enum { + name: "Direction" + values: { + "LeftToRight": 0, + "RightToLeft": 1, + "DirectionAuto": 2 + } + } + Property { name: "origin"; type: "QUrl"; isReadonly: true } + Property { name: "icon"; type: "QIcon"; isReadonly: true } + Property { name: "title"; type: "string"; isReadonly: true } + Property { name: "message"; type: "string"; isReadonly: true } + Property { name: "tag"; type: "string"; isReadonly: true } + Property { name: "language"; type: "string"; isReadonly: true } + Property { name: "direction"; type: "Direction"; isReadonly: true } + Signal { name: "closed" } + Method { name: "show" } + Method { name: "click" } + Method { name: "close" } + } Component { name: "QWebEngineQuotaRequest" exports: ["QtWebEngine/QuotaRequest 1.7"] -- cgit v1.2.3 From 678cb710bb07188454b19a70b5e5595b8ea41c2a Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Fri, 22 Feb 2019 12:24:05 +0100 Subject: Doc: Talk about 'empty string' in WebEngineProfile::downloadPath This is clearer than 'null string', and actually also what the code checks for. Change-Id: I856de48016b609cb7a8be1286f8be51ad765abd6 Reviewed-by: Leena Miettinen --- src/webengine/api/qquickwebengineprofile.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/webengine') diff --git a/src/webengine/api/qquickwebengineprofile.cpp b/src/webengine/api/qquickwebengineprofile.cpp index edd460f3a..061e210fb 100644 --- a/src/webengine/api/qquickwebengineprofile.cpp +++ b/src/webengine/api/qquickwebengineprofile.cpp @@ -881,7 +881,7 @@ bool QQuickWebEngineProfile::isUsedForGlobalCertificateVerification() const Overrides the default path used for download location. - If set to the null string, the default path is restored. + If set to an empty string, the default path is restored. \note By default, the download path is QStandardPaths::DownloadLocation. */ @@ -894,7 +894,7 @@ bool QQuickWebEngineProfile::isUsedForGlobalCertificateVerification() const Overrides the default path used for download location, setting it to \a path. - If set to the null string, the default path is restored. + If set to an empty string, the default path is restored. \note By default, the download path is QStandardPaths::DownloadLocation. */ -- cgit v1.2.3 From ee10e6ad4d2d8fdf40c57d7eefcfbff7b8fc2af6 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Fri, 22 Feb 2019 10:12:11 +0100 Subject: Doc: Rename 'Notificatons' section to 'Web Notifications' This is more descriptive / easier to search for. It also makes sure the feature list is again alphabetically sorted. Change-Id: Ib5276e06b64f01a8d6b92067d4a74274a9555636 Reviewed-by: Leena Miettinen --- src/webengine/doc/src/external-resources.qdoc | 5 +++++ src/webengine/doc/src/qtwebengine-features.qdoc | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'src/webengine') diff --git a/src/webengine/doc/src/external-resources.qdoc b/src/webengine/doc/src/external-resources.qdoc index 7ff6eea6b..e4fe9bba6 100644 --- a/src/webengine/doc/src/external-resources.qdoc +++ b/src/webengine/doc/src/external-resources.qdoc @@ -146,3 +146,8 @@ \externalpage https://developer.mozilla.org/en-US/docs/Web/API/Navigator/registerProtocolHandler \title registerProtocolHandler */ + +/*! + \externalpage https://www.w3.org/TR/notifications + \title Web Notifications API +*/ diff --git a/src/webengine/doc/src/qtwebengine-features.qdoc b/src/webengine/doc/src/qtwebengine-features.qdoc index 64e9badb1..f53c118a8 100644 --- a/src/webengine/doc/src/qtwebengine-features.qdoc +++ b/src/webengine/doc/src/qtwebengine-features.qdoc @@ -50,7 +50,7 @@ \li \l{Touch} \li \l{View Source} \li \l{WebRTC} - \li \l{Notifications} + \li \l{Web Notifications} \endlist \section1 Audio and Video Codecs @@ -513,9 +513,9 @@ opening \c https://test.webrtc.org/ in \l{WebEngine Widgets Simple Browser Example}{Simple Browser} or \l{WebEngine Quick Nano Browser}{Nano Browser}. - \section1 Notifications + \section1 Web Notifications - Qt WebEngine supports JavaScript Web Notification API. + Qt WebEngine supports JavaScript \l{Web Notifications API}. The application has to explicitly allow the feature by using QWebEnginePage::Notifications or \l{WebEngineView::Feature} {WebEngineView.Notifications}. -- cgit v1.2.3 From 0091ec9046c2c4812dee109fcbfb8372d9435461 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Tue, 26 Feb 2019 11:31:46 +0100 Subject: Doc: Fix JavaScriptDialogRequest.DialogTypeBeforeUnload enum value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: QTBUG-74070 Change-Id: Iad514671a588c0a3e0405dd0141ef54320ae8c86 Reviewed-by: Jüri Valdmann --- src/webengine/api/qquickwebenginedialogrequests.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/webengine') diff --git a/src/webengine/api/qquickwebenginedialogrequests.cpp b/src/webengine/api/qquickwebenginedialogrequests.cpp index b1f52a6b1..d6bba9a98 100644 --- a/src/webengine/api/qquickwebenginedialogrequests.cpp +++ b/src/webengine/api/qquickwebenginedialogrequests.cpp @@ -340,8 +340,8 @@ QString QQuickWebEngineJavaScriptDialogRequest::title() const \qmlproperty enumeration JavaScriptDialogRequest::type \readonly - Returns the type of the requested dialog box, see HTML5's - + Returns the type of the requested dialog box. For more information, see + HTML5's \l{https://www.w3.org/TR/html5/webappapis.html#simple-dialogs}{Simple Dialogs}. \value JavaScriptDialogRequest.DialogTypeAlert @@ -350,7 +350,7 @@ QString QQuickWebEngineJavaScriptDialogRequest::title() const A JavaScript confirmation dialog. \value JavaScriptDialogRequest.DialogTypePrompt A JavaScript prompt dialog. - \value JavaScriptDialogRequest.DialogTypeUnload + \value JavaScriptDialogRequest.DialogTypeBeforeUnload The users should be asked if they want to leave the page. */ -- cgit v1.2.3 From 28d3a4eb261318046464ea18d329aeecb9f1d9d0 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 27 Feb 2019 11:20:19 +0100 Subject: Cleanup QML client certificate selection implementation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Get rid of copy constructors for QObjects by making the elements objects on the heap. Change-Id: Ic9a214f01b39feb824b99d17d17fd342d431cd97 Reviewed-by: Jüri Valdmann Reviewed-by: Michal Klocek --- .../api/qquickwebengineclientcertificateselection.cpp | 19 +++---------------- .../api/qquickwebengineclientcertificateselection_p.h | 6 +----- src/webengine/plugin/plugin.cpp | 4 ++-- 3 files changed, 6 insertions(+), 23 deletions(-) (limited to 'src/webengine') diff --git a/src/webengine/api/qquickwebengineclientcertificateselection.cpp b/src/webengine/api/qquickwebengineclientcertificateselection.cpp index 56cf1ff64..c48a59887 100644 --- a/src/webengine/api/qquickwebengineclientcertificateselection.cpp +++ b/src/webengine/api/qquickwebengineclientcertificateselection.cpp @@ -55,23 +55,10 @@ QT_BEGIN_NAMESPACE \sa {WebEngineClientCertificateSelection::certificates} {WebEngineClientCertificateSelection.certificates} */ -QQuickWebEngineClientCertificateOption::QQuickWebEngineClientCertificateOption() = default; - QQuickWebEngineClientCertificateOption::QQuickWebEngineClientCertificateOption(QQuickWebEngineClientCertificateSelection *selection, int index) - : QObject(), m_selection(selection), m_index(index) -{} - -QQuickWebEngineClientCertificateOption::QQuickWebEngineClientCertificateOption(const QQuickWebEngineClientCertificateOption &other) - : QObject(), m_selection(other.m_selection), m_index(other.m_index) + : QObject(selection), m_selection(selection), m_index(index) {} -QQuickWebEngineClientCertificateOption &QQuickWebEngineClientCertificateOption::operator=(const QQuickWebEngineClientCertificateOption &other) -{ - m_selection = other.m_selection; - m_index = other.m_index; - return *this; -} - /*! \qmlproperty string WebEngineClientCertificateOption::issuer \brief The issuer of the certificate. @@ -164,7 +151,7 @@ QQuickWebEngineClientCertificateOption *QQuickWebEngineClientCertificateSelectio QQuickWebEngineClientCertificateSelection *d = static_cast(p->object); if (idx < 0 || idx >= d->m_certificates.size()) return nullptr; - return &d->m_certificates[idx]; + return d->m_certificates[idx]; } /*! @@ -177,7 +164,7 @@ QQmlListProperty QQuickWebEngineClientCe if (m_certificates.empty()) { QVector certificates = d_ptr->certificates(); for (int i = 0; i < certificates.count(); ++i) - m_certificates.push_back(QQuickWebEngineClientCertificateOption(this, i)); + m_certificates.push_back(new QQuickWebEngineClientCertificateOption(this, i)); } return QQmlListProperty( diff --git a/src/webengine/api/qquickwebengineclientcertificateselection_p.h b/src/webengine/api/qquickwebengineclientcertificateselection_p.h index 7f5a26296..adf8b5f7c 100644 --- a/src/webengine/api/qquickwebengineclientcertificateselection_p.h +++ b/src/webengine/api/qquickwebengineclientcertificateselection_p.h @@ -76,10 +76,6 @@ class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineClientCertificateOption : public Q_PROPERTY(bool isSelfSigned READ isSelfSigned CONSTANT FINAL) public: - QQuickWebEngineClientCertificateOption(); - QQuickWebEngineClientCertificateOption(const QQuickWebEngineClientCertificateOption &); - QQuickWebEngineClientCertificateOption &operator=(const QQuickWebEngineClientCertificateOption &); - QString issuer() const; QString subject() const; QDateTime effectiveDate() const; @@ -120,7 +116,7 @@ private: explicit QQuickWebEngineClientCertificateSelection(QSharedPointer); - mutable QVector m_certificates; + mutable QVector m_certificates; QSharedPointer d_ptr; }; diff --git a/src/webengine/plugin/plugin.cpp b/src/webengine/plugin/plugin.cpp index 82a76760d..381837e08 100644 --- a/src/webengine/plugin/plugin.cpp +++ b/src/webengine/plugin/plugin.cpp @@ -159,9 +159,9 @@ public: msgUncreatableType("RegisterProtocolHandlerRequest")); qmlRegisterUncreatableType(uri, 1, 8, "WebEngineAction", msgUncreatableType("WebEngineAction")); qmlRegisterUncreatableType(uri, 1, 9, "WebEngineClientCertificateSelection", - tr("Cannot create a separate instance of WebEngineClientCertificateSelection")); + msgUncreatableType("WebEngineClientCertificateSelection")); qmlRegisterUncreatableType(uri, 1, 9, "WebEngineClientCertificateOption", - tr("Cannot create a separate instance of WebEngineClientCertificateOption")); + msgUncreatableType("WebEngineClientCertificateOption")); qmlRegisterUncreatableType(uri, 1, 9, "WebEngineNotification", msgUncreatableType("WebEngineNotification")); } -- cgit v1.2.3 From 56fadb571f32b721d8b99554e6e38692009ec37f Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Thu, 28 Feb 2019 10:49:22 +0100 Subject: Force destruction of webcontent client before profile adapter Currently users might forget to delete webcontent client before profile adapter. This might be nasty if users are not aware of default profile. Instead of asserting badly in chromium, clean up and release chromium resources. This avoids the crash, but might leak memory if users never deletes page. Task-number: QTBUG-74021 Change-Id: I66f466f169d12f7ee08866d505260dca47800bb0 Reviewed-by: Allan Sandfeld Jensen --- src/webengine/api/qquickwebengineprofile.cpp | 15 ++++++--------- src/webengine/api/qquickwebengineprofile_p.h | 5 ++--- src/webengine/api/qquickwebengineview.cpp | 2 +- src/webengine/api/qquickwebengineview_p_p.h | 2 +- 4 files changed, 10 insertions(+), 14 deletions(-) (limited to 'src/webengine') diff --git a/src/webengine/api/qquickwebengineprofile.cpp b/src/webengine/api/qquickwebengineprofile.cpp index b7abb13fc..73577a04c 100644 --- a/src/webengine/api/qquickwebengineprofile.cpp +++ b/src/webengine/api/qquickwebengineprofile.cpp @@ -163,11 +163,6 @@ QQuickWebEngineProfilePrivate::QQuickWebEngineProfilePrivate(ProfileAdapter *pro QQuickWebEngineProfilePrivate::~QQuickWebEngineProfilePrivate() { - - while (!m_webContentsAdapterClients.isEmpty()) { - m_webContentsAdapterClients.first()->destroy(); - } - if (m_profileAdapter) { // In the case the user sets this profile as the parent of the interceptor // it can be deleted before the browser-context still referencing it is. @@ -179,14 +174,16 @@ QQuickWebEngineProfilePrivate::~QQuickWebEngineProfilePrivate() delete m_profileAdapter; } -void QQuickWebEngineProfilePrivate::addWebContentsAdapterClient(QQuickWebEngineViewPrivate *adapter) +void QQuickWebEngineProfilePrivate::addWebContentsAdapterClient(QtWebEngineCore::WebContentsAdapterClient *adapter) { - m_webContentsAdapterClients.append(adapter); + Q_ASSERT(m_profileAdapter); + m_profileAdapter->addWebContentsAdapterClient(adapter); } -void QQuickWebEngineProfilePrivate::removeWebContentsAdapterClient(QQuickWebEngineViewPrivate*adapter) +void QQuickWebEngineProfilePrivate::removeWebContentsAdapterClient(QtWebEngineCore::WebContentsAdapterClient*adapter) { - m_webContentsAdapterClients.removeAll(adapter); + Q_ASSERT(m_profileAdapter); + m_profileAdapter->removeWebContentsAdapterClient(adapter); } QtWebEngineCore::ProfileAdapter *QQuickWebEngineProfilePrivate::profileAdapter() const diff --git a/src/webengine/api/qquickwebengineprofile_p.h b/src/webengine/api/qquickwebengineprofile_p.h index 2b1a5b134..41e513f4c 100644 --- a/src/webengine/api/qquickwebengineprofile_p.h +++ b/src/webengine/api/qquickwebengineprofile_p.h @@ -71,8 +71,8 @@ public: Q_DECLARE_PUBLIC(QQuickWebEngineProfile) QQuickWebEngineProfilePrivate(QtWebEngineCore::ProfileAdapter *profileAdapter); ~QQuickWebEngineProfilePrivate(); - void addWebContentsAdapterClient(QQuickWebEngineViewPrivate *adapter); - void removeWebContentsAdapterClient(QQuickWebEngineViewPrivate *adapter); + void addWebContentsAdapterClient(QtWebEngineCore::WebContentsAdapterClient *adapter) override; + void removeWebContentsAdapterClient(QtWebEngineCore::WebContentsAdapterClient *adapter) override; QtWebEngineCore::ProfileAdapter* profileAdapter() const; QQuickWebEngineSettings *settings() const; @@ -98,7 +98,6 @@ private: QPointer m_profileAdapter; QMap > m_ongoingDownloads; QList m_userScripts; - QVector m_webContentsAdapterClients; }; QT_END_NAMESPACE diff --git a/src/webengine/api/qquickwebengineview.cpp b/src/webengine/api/qquickwebengineview.cpp index 35f797cb1..53f12fa97 100644 --- a/src/webengine/api/qquickwebengineview.cpp +++ b/src/webengine/api/qquickwebengineview.cpp @@ -189,7 +189,7 @@ bool QQuickWebEngineViewPrivate::profileInitialized() const return m_profileInitialized; } -void QQuickWebEngineViewPrivate::destroy() +void QQuickWebEngineViewPrivate::releaseProfile() { // The profile for this web contents is about to be // garbage collected, delete WebContents first and diff --git a/src/webengine/api/qquickwebengineview_p_p.h b/src/webengine/api/qquickwebengineview_p_p.h index cbba9b568..bc7a05b67 100644 --- a/src/webengine/api/qquickwebengineview_p_p.h +++ b/src/webengine/api/qquickwebengineview_p_p.h @@ -90,7 +90,7 @@ public: QQuickWebEngineView *q_ptr; QQuickWebEngineViewPrivate(); ~QQuickWebEngineViewPrivate(); - void destroy(); + void releaseProfile() override; void initializeProfile(); QtWebEngineCore::UIDelegatesManager *ui(); -- cgit v1.2.3 From 4dc312011bcaa2ee2cf812b5b84dc9238130e608 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 27 Feb 2019 13:49:30 +0100 Subject: Tie client certificate stores to profiles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move the client certificate store from being global to being tied to individual profiles. Change-Id: Ib21ae14c501b7d0612b84ae7535120291aeeada2 Reviewed-by: Jüri Valdmann --- src/webengine/api/qquickwebengineprofile.cpp | 11 +++++++++++ src/webengine/api/qquickwebengineprofile.h | 3 +++ 2 files changed, 14 insertions(+) (limited to 'src/webengine') diff --git a/src/webengine/api/qquickwebengineprofile.cpp b/src/webengine/api/qquickwebengineprofile.cpp index 061e210fb..0ec4b19ce 100644 --- a/src/webengine/api/qquickwebengineprofile.cpp +++ b/src/webengine/api/qquickwebengineprofile.cpp @@ -1072,4 +1072,15 @@ QQmlListProperty QQuickWebEngineProfile::userScripts() d->userScripts_clear); } +/*! + \since 5.13 + + Returns the profile's client certificate store. +*/ +QWebEngineClientCertificateStore *QQuickWebEngineProfile::clientCertificateStore() +{ + Q_D(QQuickWebEngineProfile); + return d->profileAdapter()->clientCertificateStore(); +} + QT_END_NAMESPACE diff --git a/src/webengine/api/qquickwebengineprofile.h b/src/webengine/api/qquickwebengineprofile.h index 406d766f9..e6f9fb73d 100644 --- a/src/webengine/api/qquickwebengineprofile.h +++ b/src/webengine/api/qquickwebengineprofile.h @@ -54,6 +54,7 @@ class QQuickWebEngineDownloadItem; class QQuickWebEngineProfilePrivate; class QQuickWebEngineScript; class QQuickWebEngineSettings; +class QWebEngineClientCertificateStore; class QWebEngineCookieStore; class QWebEngineNotification; class QWebEngineUrlRequestInterceptor; @@ -153,6 +154,8 @@ public: QString downloadPath() const; void setDownloadPath(const QString &path); + QWebEngineClientCertificateStore *clientCertificateStore(); + static QQuickWebEngineProfile *defaultProfile(); Q_SIGNALS: -- cgit v1.2.3 From dc6c8d5c9fe61ba58d065564f4d6dc0571475004 Mon Sep 17 00:00:00 2001 From: Peter Varga Date: Wed, 6 Mar 2019 13:56:01 +0100 Subject: Fix -no-ssl build Change-Id: I978f70545484060218f5243c74978c85bc603c16 Reviewed-by: Allan Sandfeld Jensen --- src/webengine/api/qquickwebengineprofile.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/webengine') diff --git a/src/webengine/api/qquickwebengineprofile.cpp b/src/webengine/api/qquickwebengineprofile.cpp index 3c4ec0595..ac75b5356 100644 --- a/src/webengine/api/qquickwebengineprofile.cpp +++ b/src/webengine/api/qquickwebengineprofile.cpp @@ -1086,8 +1086,12 @@ QQmlListProperty QQuickWebEngineProfile::userScripts() */ QWebEngineClientCertificateStore *QQuickWebEngineProfile::clientCertificateStore() { +#if QT_CONFIG(ssl) Q_D(QQuickWebEngineProfile); return d->profileAdapter()->clientCertificateStore(); +#else + return nullptr; +#endif } QT_END_NAMESPACE -- cgit v1.2.3 From f4e041643d5f05330e6495d83f2e583da97a69d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Br=C3=BCning?= Date: Tue, 19 Mar 2019 11:35:44 +0100 Subject: Fix capitalisation of letters for PDF viewer setting PDFViewerEnabled is renamed to PdfViewerEnabled. Task-number: QTBUG-74543 Change-Id: I48a242a52ab0689b06815ac3cbd98c44902cc358 Reviewed-by: Kai Koehne --- src/webengine/api/qquickwebenginesettings.cpp | 8 ++++---- src/webengine/api/qquickwebenginesettings_p.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/webengine') diff --git a/src/webengine/api/qquickwebenginesettings.cpp b/src/webengine/api/qquickwebenginesettings.cpp index 4f6a8c148..93a3668ed 100644 --- a/src/webengine/api/qquickwebenginesettings.cpp +++ b/src/webengine/api/qquickwebenginesettings.cpp @@ -467,7 +467,7 @@ bool QQuickWebEngineSettings::dnsPrefetchEnabled() const */ bool QQuickWebEngineSettings::pdfViewerEnabled() const { - return d_ptr->testAttribute(WebEngineSettings::PDFViewerEnabled); + return d_ptr->testAttribute(WebEngineSettings::PdfViewerEnabled); } /*! @@ -728,10 +728,10 @@ void QQuickWebEngineSettings::setDnsPrefetchEnabled(bool on) Q_EMIT dnsPrefetchEnabledChanged(); } -void QQuickWebEngineSettings::setPDFViewerEnabled(bool on) +void QQuickWebEngineSettings::setPdfViewerEnabled(bool on) { - bool wasOn = d_ptr->testAttribute(WebEngineSettings::PDFViewerEnabled); - d_ptr->setAttribute(WebEngineSettings::PDFViewerEnabled, on); + bool wasOn = d_ptr->testAttribute(WebEngineSettings::PdfViewerEnabled); + d_ptr->setAttribute(WebEngineSettings::PdfViewerEnabled, on); if (wasOn != on) Q_EMIT pdfViewerEnabledChanged(); } diff --git a/src/webengine/api/qquickwebenginesettings_p.h b/src/webengine/api/qquickwebenginesettings_p.h index ae6703bd2..ce43e0e9c 100644 --- a/src/webengine/api/qquickwebenginesettings_p.h +++ b/src/webengine/api/qquickwebenginesettings_p.h @@ -93,7 +93,7 @@ class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineSettings : public QObject { Q_PROPERTY(bool webRTCPublicInterfacesOnly READ webRTCPublicInterfacesOnly WRITE setWebRTCPublicInterfacesOnly NOTIFY webRTCPublicInterfacesOnlyChanged REVISION 6 FINAL) Q_PROPERTY(bool javascriptCanPaste READ javascriptCanPaste WRITE setJavascriptCanPaste NOTIFY javascriptCanPasteChanged REVISION 6 FINAL) Q_PROPERTY(bool dnsPrefetchEnabled READ dnsPrefetchEnabled WRITE setDnsPrefetchEnabled NOTIFY dnsPrefetchEnabledChanged REVISION 7 FINAL) - Q_PROPERTY(bool pdfViewerEnabled READ pdfViewerEnabled WRITE setPDFViewerEnabled NOTIFY pdfViewerEnabledChanged REVISION 8 FINAL) + Q_PROPERTY(bool pdfViewerEnabled READ pdfViewerEnabled WRITE setPdfViewerEnabled NOTIFY pdfViewerEnabledChanged REVISION 8 FINAL) public: enum UnknownUrlSchemePolicy { @@ -168,7 +168,7 @@ public: void setWebRTCPublicInterfacesOnly(bool on); void setJavascriptCanPaste(bool on); void setDnsPrefetchEnabled(bool on); - void setPDFViewerEnabled(bool on); + void setPdfViewerEnabled(bool on); signals: void autoLoadImagesChanged(); -- cgit v1.2.3 From d5a479a720ee76fae9fa7b0f7b6b3d0a61718ff0 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Wed, 20 Mar 2019 17:36:24 +0100 Subject: Update plugins.qmltypes for Qt 5.13 Change-Id: I0456c67f1edd0c4caa6d0c0f7b643024b00ce960 Reviewed-by: Allan Sandfeld Jensen --- src/webengine/plugin/plugins.qmltypes | 4 +- src/webengine/testsupport/plugins.qmltypes | 73 ++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 src/webengine/testsupport/plugins.qmltypes (limited to 'src/webengine') diff --git a/src/webengine/plugin/plugins.qmltypes b/src/webengine/plugin/plugins.qmltypes index 74c710e8b..cc2ed502d 100644 --- a/src/webengine/plugin/plugins.qmltypes +++ b/src/webengine/plugin/plugins.qmltypes @@ -532,7 +532,7 @@ Module { } Signal { name: "userNotification" - revision: 6 + revision: 5 Parameter { name: "notification"; type: "QWebEngineNotification"; isPointer: true } } Method { name: "clearHttpCache"; revision: 2 } @@ -667,6 +667,7 @@ Module { Property { name: "webRTCPublicInterfacesOnly"; revision: 6; type: "bool" } Property { name: "javascriptCanPaste"; revision: 6; type: "bool" } Property { name: "dnsPrefetchEnabled"; revision: 7; type: "bool" } + Property { name: "pdfViewerEnabled"; revision: 8; type: "bool" } Signal { name: "fullScreenSupportEnabledChanged"; revision: 1 } Signal { name: "screenCaptureEnabledChanged"; revision: 2 } Signal { name: "webGLEnabledChanged"; revision: 2 } @@ -684,6 +685,7 @@ Module { Signal { name: "webRTCPublicInterfacesOnlyChanged"; revision: 6 } Signal { name: "javascriptCanPasteChanged"; revision: 6 } Signal { name: "dnsPrefetchEnabledChanged"; revision: 7 } + Signal { name: "pdfViewerEnabledChanged"; revision: 8 } } Component { name: "QQuickWebEngineSingleton" diff --git a/src/webengine/testsupport/plugins.qmltypes b/src/webengine/testsupport/plugins.qmltypes new file mode 100644 index 000000000..12c763724 --- /dev/null +++ b/src/webengine/testsupport/plugins.qmltypes @@ -0,0 +1,73 @@ +import QtQuick.tooling 1.2 + +// This file describes the plugin-supplied types contained in the library. +// It is used for QML tooling purposes only. +// +// This file was auto-generated by: +// 'qmlplugindump -nonrelocatable QtWebEngine.testsupport 1.0' + +Module { + dependencies: ["QtQuick 2.0"] + Component { name: "QPlatformInputContext"; prototype: "QObject" } + Component { + name: "QQuickWebEngineErrorPage" + prototype: "QObject" + exports: ["QtWebEngine.testsupport/WebEngineErrorPage 1.0"] + isCreatable: false + exportMetaObjectRevisions: [0] + Signal { + name: "loadingChanged" + Parameter { name: "loadRequest"; type: "QQuickWebEngineLoadRequest"; isPointer: true } + } + } + Component { + name: "QQuickWebEngineTestEvent" + prototype: "QObject" + exports: ["QtWebEngine.testsupport/WebEngineTestEvent 1.0"] + isCreatable: false + exportMetaObjectRevisions: [0] + Method { + name: "mouseMultiClick" + type: "bool" + Parameter { name: "item"; type: "QObject"; isPointer: true } + Parameter { name: "x"; type: "double" } + Parameter { name: "y"; type: "double" } + Parameter { name: "clickCount"; type: "int" } + } + } + Component { + name: "QQuickWebEngineTestInputContext" + prototype: "QPlatformInputContext" + exports: ["QtWebEngine.testsupport/TestInputContext 1.0"] + isCreatable: false + exportMetaObjectRevisions: [0] + Method { name: "create" } + Method { name: "release" } + } + Component { + name: "QQuickWebEngineTestSupport" + prototype: "QObject" + exports: ["QtWebEngine.testsupport/WebEngineTestSupport 1.0"] + exportMetaObjectRevisions: [0] + Property { + name: "errorPage" + type: "QQuickWebEngineErrorPage" + isReadonly: true + isPointer: true + } + Property { + name: "testInputContext" + type: "QQuickWebEngineTestInputContext" + isReadonly: true + isPointer: true + } + Property { + name: "testEvent" + type: "QQuickWebEngineTestEvent" + isReadonly: true + isPointer: true + } + Signal { name: "windowCloseRejected" } + Signal { name: "loadVisuallyCommitted" } + } +} -- cgit v1.2.3