Examples: Centralize constants in one place

Having all constants in WelcomePageHelpers makes reading the welcome
scren code a bit less interesting.

Change-Id: Idc2e402f33042b49d041c43ecc78a6e8d2d3536a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Alessandro Portale
2023-05-02 18:28:12 +02:00
parent 2a5f2961a7
commit 765e8a65ea
5 changed files with 17 additions and 18 deletions

View File

@@ -255,7 +255,8 @@ static QPixmap fetchPixmapAndUpdatePixmapCache(const QString &url)
img.convertTo(QImage::Format_RGB32);
const int dpr = qApp->devicePixelRatio();
// boundedTo -> don't scale thumbnails up
const QSize scaledSize = Core::ListModel::defaultImageSize.boundedTo(img.size()) * dpr;
const QSize scaledSize =
WelcomePageHelpers::GridItemImageSize.boundedTo(img.size()) * dpr;
pixmap = QPixmap::fromImage(
img.scaled(scaledSize, Qt::KeepAspectRatio, Qt::SmoothTransformation));
pixmap.setDevicePixelRatio(dpr);