diff options
author | Rym Bouabid <rym.bouabid@qt.io> | 2023-09-20 18:12:29 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2023-10-04 12:10:56 +0000 |
commit | f0dcceb45ef046ef57f0ac82176099363d0a9db3 (patch) | |
tree | 400083ed6e283ee389de8c9d4b159654a5d39395 /examples/corelib/threads/queuedcustomtype/window.cpp | |
parent | fbe26073def8a4dbdb255eb48a5c59068e99aad9 (diff) |
Revamp Queued Custom Type Ex: Add const when applicable
Task-number: QTBUG-117147
Change-Id: I2fe342fa585f8c1203fa64d2a9ceabc07070cc77
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 34ff72d0ba5284ff117ee4ae7f04072b51c85315)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit a1098f4462ef387ca4dac5354867c29df9fc093f)
Diffstat (limited to 'examples/corelib/threads/queuedcustomtype/window.cpp')
-rw-r--r-- | examples/corelib/threads/queuedcustomtype/window.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/corelib/threads/queuedcustomtype/window.cpp b/examples/corelib/threads/queuedcustomtype/window.cpp index a91b2e6b8d..9a56007b40 100644 --- a/examples/corelib/threads/queuedcustomtype/window.cpp +++ b/examples/corelib/threads/queuedcustomtype/window.cpp @@ -60,13 +60,13 @@ void Window::loadImage() if (format.toLower() == format) formats.append(QLatin1String("*.") + QString::fromLatin1(format)); - QString newPath = QFileDialog::getOpenFileName(this, tr("Open Image"), + const QString newPath = QFileDialog::getOpenFileName(this, tr("Open Image"), path, tr("Image files (%1)").arg(formats.join(' '))); if (newPath.isEmpty()) return; - QImage image(newPath); + const QImage image(newPath); if (!image.isNull()) { loadImage(image); path = newPath; @@ -76,7 +76,7 @@ void Window::loadImage() void Window::loadImage(const QImage &image) { QImage useImage; - QRect space = QGuiApplication::primaryScreen()->availableGeometry(); + const QRect space = QGuiApplication::primaryScreen()->availableGeometry(); if (image.width() > 0.75*space.width() || image.height() > 0.75*space.height()) useImage = image.scaled(0.75*space.width(), 0.75*space.height(), Qt::KeepAspectRatio, Qt::SmoothTransformation); |