diff options
author | Peter Varga <pvarga@inf.u-szeged.hu> | 2021-06-08 16:28:58 +0200 |
---|---|---|
committer | Peter Varga <pvarga@inf.u-szeged.hu> | 2021-06-10 18:28:52 +0200 |
commit | 740b8c94f27930a33298c81c2284d1f0a9e2f11b (patch) | |
tree | 097150a08452efb33444b3228111fd02679dddf7 /src | |
parent | b8804bf868c9f9b18a8b1caa9f512659113ddb98 (diff) |
Fix some compiler warnings
- Remove deprecated Qt::AA_EnableHighDpiScaling and Qt::AA_UseHighDpiPixmaps
from examples. High-DPI scaling is always enabled.
- Reorder initialization of members of QWebEngineDownloadRequestPrivate.
Also remove m_ prefix from public members' name.
- Remove unused parameters from methods of DummyDelegate.
- Add missing overrides in auto tests.
Pick-to: 6.2
Change-Id: I18d6973b8bee574b37b73fbaaa8d57002ac8ba2d
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/core/api/qwebenginedownloadrequest.cpp | 26 | ||||
-rw-r--r-- | src/core/api/qwebenginedownloadrequest_p.h | 4 | ||||
-rw-r--r-- | src/core/api/qwebenginepage.cpp | 10 | ||||
-rw-r--r-- | src/core/api/qwebengineprofile.cpp | 4 | ||||
-rw-r--r-- | src/webenginequick/api/qquickwebengineprofile.cpp | 4 |
5 files changed, 25 insertions, 23 deletions
diff --git a/src/core/api/qwebenginedownloadrequest.cpp b/src/core/api/qwebenginedownloadrequest.cpp index eae48b017..006fd2e4b 100644 --- a/src/core/api/qwebenginedownloadrequest.cpp +++ b/src/core/api/qwebenginedownloadrequest.cpp @@ -158,8 +158,7 @@ static inline QWebEngineDownloadRequest::DownloadInterruptReason toDownloadInter */ QWebEngineDownloadRequestPrivate::QWebEngineDownloadRequestPrivate(QtWebEngineCore::ProfileAdapter *adapter, const QUrl &url) - : m_profileAdapter(adapter) - , downloadFinished(false) + : downloadFinished(false) , downloadId(-1) , downloadState(QWebEngineDownloadRequest::DownloadCancelled) , savePageFormat(QWebEngineDownloadRequest::MimeHtmlSaveFormat) @@ -170,7 +169,8 @@ QWebEngineDownloadRequestPrivate::QWebEngineDownloadRequestPrivate(QtWebEngineCo , totalBytes(-1) , receivedBytes(0) , isSavePageDownload(false) - , m_adapterClient(nullptr) + , profileAdapter(adapter) + , adapterClient(nullptr) { } @@ -272,8 +272,8 @@ void QWebEngineDownloadRequest::cancel() // We directly cancel the download request if the user cancels // before it even started, so no need to notify the profile here. if (state == QWebEngineDownloadRequest::DownloadInProgress) { - if (d->m_profileAdapter) - d->m_profileAdapter->cancelDownload(d->downloadId); + if (d->profileAdapter) + d->profileAdapter->cancelDownload(d->downloadId); } else { d->downloadState = QWebEngineDownloadRequest::DownloadCancelled; Q_EMIT stateChanged(d->downloadState); @@ -299,8 +299,8 @@ void QWebEngineDownloadRequest::pause() if (state != QWebEngineDownloadRequest::DownloadInProgress) return; - if (d->m_profileAdapter) - d->m_profileAdapter->pauseDownload(d->downloadId); + if (d->profileAdapter) + d->profileAdapter->pauseDownload(d->downloadId); } /*! @@ -319,8 +319,8 @@ void QWebEngineDownloadRequest::resume() if (d->downloadFinished || (state != QWebEngineDownloadRequest::DownloadInProgress && state != QWebEngineDownloadRequest::DownloadInterrupted)) return; - if (d->m_profileAdapter) - d->m_profileAdapter->resumeDownload(d->downloadId); + if (d->profileAdapter) + d->profileAdapter->resumeDownload(d->downloadId); } /*! @@ -521,10 +521,10 @@ void QWebEngineDownloadRequest::setDownloadDirectory(const QString &directory) Q_EMIT downloadDirectoryChanged(); } - if (!d->isCustomFileName && d->m_profileAdapter) { - QString newFileName = QFileInfo(d->m_profileAdapter->determineDownloadPath(d->downloadDirectory, - d->suggestedFileName, - d->startTime)).fileName(); + if (!d->isCustomFileName && d->profileAdapter) { + QString newFileName = QFileInfo(d->profileAdapter->determineDownloadPath(d->downloadDirectory, + d->suggestedFileName, + d->startTime)).fileName(); if (d->downloadFileName != newFileName) { d->downloadFileName = newFileName; Q_EMIT downloadFileNameChanged(); diff --git a/src/core/api/qwebenginedownloadrequest_p.h b/src/core/api/qwebenginedownloadrequest_p.h index db2e70852..49980dbb8 100644 --- a/src/core/api/qwebenginedownloadrequest_p.h +++ b/src/core/api/qwebenginedownloadrequest_p.h @@ -90,8 +90,8 @@ public: qint64 receivedBytes; bool isSavePageDownload; QWebEngineDownloadRequest *q_ptr; - QPointer<QtWebEngineCore::ProfileAdapter> m_profileAdapter; - QtWebEngineCore::WebContentsAdapterClient *m_adapterClient; + QPointer<QtWebEngineCore::ProfileAdapter> profileAdapter; + QtWebEngineCore::WebContentsAdapterClient *adapterClient; Q_DECLARE_PUBLIC(QWebEngineDownloadRequest) }; diff --git a/src/core/api/qwebenginepage.cpp b/src/core/api/qwebenginepage.cpp index 1aa29669b..499343bb3 100644 --- a/src/core/api/qwebenginepage.cpp +++ b/src/core/api/qwebenginepage.cpp @@ -104,7 +104,9 @@ public: bool isVisible() const override { Q_UNREACHABLE(); } QWindow *window() const override { return nullptr; } void updateCursor(const QCursor &cursor) override - { /*setCursor(cursor);*/ + { + Q_UNUSED(cursor); + /*setCursor(cursor);*/ } void resize(int width, int height) override { @@ -115,8 +117,8 @@ public: void inputMethodStateChanged(bool, bool) override { } void setInputMethodHints(Qt::InputMethodHints) override { } void setClearColor(const QColor &) override { } - void adapterClientChanged(WebContentsAdapterClient *client) override { } - bool copySurface(const QRect &rect, const QSize &size, QImage &image) + void adapterClientChanged(WebContentsAdapterClient *) override { } + bool copySurface(const QRect &, const QSize &, QImage &) { Q_UNREACHABLE(); return false; @@ -2392,7 +2394,7 @@ void QWebEnginePage::setVisible(bool visible) } QWebEnginePage* QWebEnginePage::fromDownloadRequest(QWebEngineDownloadRequest *request) { - return static_cast<QWebEnginePagePrivate *>(request->d_ptr->m_adapterClient)->q_ptr; + return static_cast<QWebEnginePagePrivate *>(request->d_ptr->adapterClient)->q_ptr; } QDataStream &operator<<(QDataStream &stream, const QWebEngineHistory &history) diff --git a/src/core/api/qwebengineprofile.cpp b/src/core/api/qwebengineprofile.cpp index 6f0e9d82c..d319356df 100644 --- a/src/core/api/qwebengineprofile.cpp +++ b/src/core/api/qwebengineprofile.cpp @@ -232,9 +232,9 @@ void QWebEngineProfilePrivate::downloadRequested(DownloadItemInfo &info) itemPrivate->savePageFormat = static_cast<QWebEngineDownloadRequest::SavePageFormat>(info.savePageFormat); itemPrivate->isSavePageDownload = info.isSavePageDownload; if (info.page && info.page->clientType() == QtWebEngineCore::WebContentsAdapterClient::WidgetsClient) - itemPrivate->m_adapterClient = info.page; + itemPrivate->adapterClient = info.page; else - itemPrivate->m_adapterClient = nullptr; + itemPrivate->adapterClient = nullptr; QWebEngineDownloadRequest *download = new QWebEngineDownloadRequest(itemPrivate, q); diff --git a/src/webenginequick/api/qquickwebengineprofile.cpp b/src/webenginequick/api/qquickwebengineprofile.cpp index 54da37309..c95a838af 100644 --- a/src/webenginequick/api/qquickwebengineprofile.cpp +++ b/src/webenginequick/api/qquickwebengineprofile.cpp @@ -249,9 +249,9 @@ void QQuickWebEngineProfilePrivate::downloadRequested(DownloadItemInfo &info) info.savePageFormat); itemPrivate->isSavePageDownload = info.isSavePageDownload; if (info.page && info.page->clientType() == QtWebEngineCore::WebContentsAdapterClient::QmlClient) - itemPrivate->m_adapterClient = info.page; + itemPrivate->adapterClient = info.page; else - itemPrivate->m_adapterClient = nullptr; + itemPrivate->adapterClient = nullptr; QWebEngineDownloadRequest *download = new QWebEngineDownloadRequest(itemPrivate, q); |