diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-06-18 11:39:36 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-06-21 17:49:31 +0200 |
commit | b2ecb708e149fe8914d7d0cbfcf9c300e52a029e (patch) | |
tree | f9fdc60b8e07d19e69c2cd044649f17b491e33f7 /src/webenginequick/api/qquickwebengineprofile.cpp | |
parent | 56186b555b98ed682e88c105a16e47023410f58e (diff) | |
download | qtwebengine-b2ecb708e149fe8914d7d0cbfcf9c300e52a029e.tar.gz |
Add page() and view() back to download-item
Restores a QML type but this time derived from the core type.
Pick-to: 6.2
Change-Id: I09ddb6672f7262ae31e4c57f09d019f71abccd41
Reviewed-by: Kirill Burtsev <kirill.burtsev@qt.io>
Diffstat (limited to 'src/webenginequick/api/qquickwebengineprofile.cpp')
-rw-r--r-- | src/webenginequick/api/qquickwebengineprofile.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/webenginequick/api/qquickwebengineprofile.cpp b/src/webenginequick/api/qquickwebengineprofile.cpp index c95a838af..a2f970c29 100644 --- a/src/webenginequick/api/qquickwebengineprofile.cpp +++ b/src/webenginequick/api/qquickwebengineprofile.cpp @@ -39,6 +39,7 @@ #include "qquickwebengineprofile.h" #include "qquickwebengineprofile_p.h" +#include "qquickwebenginedownloadrequest_p.h" #include "qquickwebenginesettings_p.h" #include "qquickwebenginescriptcollection.h" #include "qquickwebengineview_p_p.h" @@ -51,6 +52,7 @@ #include <QtWebEngineCore/qwebenginenotification.h> #include <QtWebEngineCore/private/qwebenginedownloadrequest_p.h> #include <QtWebEngineCore/qwebengineurlscheme.h> + #include <QFileInfo> #include <QDir> #include <QQmlEngine> @@ -126,7 +128,7 @@ QT_BEGIN_NAMESPACE */ /*! - \fn QQuickWebEngineProfile::downloadRequested(QWebEngineDownloadRequest *download) + \fn QQuickWebEngineProfile::downloadRequested(QQuickWebEngineDownloadRequest *download) This signal is emitted whenever a download has been triggered. The \a download argument holds the state of the download. @@ -139,7 +141,7 @@ QT_BEGIN_NAMESPACE */ /*! - \fn QQuickWebEngineProfile::downloadFinished(QWebEngineDownloadRequest *download) + \fn QQuickWebEngineProfile::downloadFinished(QQuickWebEngineDownloadRequest *download) This signal is emitted whenever downloading stops, because it finished successfully, was cancelled, or was interrupted (for example, because connectivity was lost). @@ -253,10 +255,10 @@ void QQuickWebEngineProfilePrivate::downloadRequested(DownloadItemInfo &info) else itemPrivate->adapterClient = nullptr; - QWebEngineDownloadRequest *download = new QWebEngineDownloadRequest(itemPrivate, q); + QQuickWebEngineDownloadRequest *download = new QQuickWebEngineDownloadRequest(itemPrivate, q); m_ongoingDownloads.insert(info.id, download); - QObject::connect(download, &QWebEngineDownloadRequest::destroyed, q, [id = info.id, this] () { downloadDestroyed(id); }); + QObject::connect(download, &QObject::destroyed, q, [id = info.id, this] () { downloadDestroyed(id); }); QQmlEngine::setObjectOwnership(download, QQmlEngine::JavaScriptOwnership); Q_EMIT q->downloadRequested(download); @@ -281,14 +283,14 @@ void QQuickWebEngineProfilePrivate::downloadUpdated(const DownloadItemInfo &info Q_Q(QQuickWebEngineProfile); - QWebEngineDownloadRequest* download = m_ongoingDownloads.value(info.id).data(); + QQuickWebEngineDownloadRequest* download = m_ongoingDownloads.value(info.id).data(); if (!download) { downloadDestroyed(info.id); return; } - download->d_func()->update(info); + download->d_ptr->update(info); if (info.state != ProfileAdapterClient::DownloadInProgress) { Q_EMIT q->downloadFinished(download); |