summaryrefslogtreecommitdiffstats
path: root/src/libs/installer/performinstallationform.cpp
diff options
context:
space:
mode:
authorArttu Tarkiainen <arttu.tarkiainen@qt.io>2020-09-10 17:20:21 +0300
committerArttu Tarkiainen <arttu.tarkiainen@qt.io>2020-09-16 09:45:13 +0300
commit913c7ea16f961a8f5688734cd12d00fbeaa5d48c (patch)
tree8cd9c58233ea51ffddbcfc2f879f78a6da17cb15 /src/libs/installer/performinstallationform.cpp
parent244b3c4e92f0909085d5068d5a8c04137068c06b (diff)
Fix image aspect ratio not preserved when resizing window
As this is not currently possible using only QLabel, subclass it with a new AspectRatioLabel class to provide the functionality. This should be usable also on other places where we need scaling with aspect ratio maintaining. Task-number: QTIFW-1944 Change-Id: I32147b2b487573bb054fcf66b09eb3f8a0350ccd Reviewed-by: Katja Marttila <katja.marttila@qt.io>
Diffstat (limited to 'src/libs/installer/performinstallationform.cpp')
-rw-r--r--src/libs/installer/performinstallationform.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/libs/installer/performinstallationform.cpp b/src/libs/installer/performinstallationform.cpp
index 2c5edf70f..28e2e1f45 100644
--- a/src/libs/installer/performinstallationform.cpp
+++ b/src/libs/installer/performinstallationform.cpp
@@ -139,11 +139,10 @@ void PerformInstallationForm::setupUi(QWidget *widget)
m_productImagesScrollArea->setObjectName(QLatin1String("ProductImagesScrollArea"));
m_productImagesScrollArea->setWidgetResizable(true);
m_productImagesScrollArea->setFrameShape(QFrame::NoFrame);
+ m_productImagesScrollArea->setStyleSheet(QLatin1String("background-color:transparent;"));
- m_productImagesLabel = new QLabel(widget);
+ m_productImagesLabel = new AspectRatioLabel(widget);
m_productImagesLabel->setObjectName(QLatin1String("ProductImagesLabel"));
- m_productImagesLabel->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
- m_productImagesLabel->setScaledContents(true);
m_productImagesScrollArea->setWidget(m_productImagesLabel);
bottomLayout->addWidget(m_productImagesScrollArea);