image size, position and aspect ratio
-
Hi!
I wrote an app using QtWidgets that runs on Android and iPhone.
In the first window there are 3 images, and I can not, no matter how many ways I tried, to make the images no to loose aspect ratio, as the app runs on a different resolution.
The images are in
QFrame, set using style sheet in the window designer.I also searched a lot, and again failed to find a solution.
Is there a way, in compile time or run time, to do it? I am running out of time, and out of options!
Thanks!
-
Why the label in the Frame ?
-
Why not use layouts ?
-
Bit late... but I feel compelled to point out that QML's Image element's support for aspect ratio scaling (take your pick of Image.PreserveAspectFit or Image.PreserveAspectCrop) combined with the horizontal and vertical alignment control properties, (if you don't just want the default centering) is absolutely brilliant for creating layouts which adapt to different screen ratios while preserving designers' original intentions about what's lined up with what. Don't know if embedding a QQuickView and a little bit of QML was an option for you though.