Layout problem
-
wrote on 5 Jan 2023, 17:57 last edited by
How can I best make this layout ? Using grid. And make all images with the same size and aspect ratio. If they have a different aspect ratio, then maybe a little crop, but also the same size, and when you increase or decrease the window, they automatically become larger or smaller for adaptive layout.
And there is another problem because of the pictures, my window is larger than the computer window, what could be the problem? Looks like that
-
Hi,
How are you doing it currently ?
One way is to paint the image on the widget yourself so you can manage the aspect ratio and paint them the way you want.
-
Hi,
How are you doing it currently ?
One way is to paint the image on the widget yourself so you can manage the aspect ratio and paint them the way you want.
wrote on 5 Jan 2023, 20:10 last edited by@SGaist I spent all day on that layout and nothing good came of it 🥹😰😩
You mean like create that images in QWidget and set QHBoxLayout not in GridLayout?
If you can check files i will be so thankful 🙏
Project Code -
I haven't said anything about layouts.
I am suggesting to subclass QWidget and reimplement the paint event. You might also want to consider reimplementing the resize event so you can ensure you have the image of the correct size to paint. Keep the original image as member variable so you can use a resized version of it for the painting.
Since you have at least three times the same widget, you should create a custom class that implements it and reuse it.
-
I haven't said anything about layouts.
I am suggesting to subclass QWidget and reimplement the paint event. You might also want to consider reimplementing the resize event so you can ensure you have the image of the correct size to paint. Keep the original image as member variable so you can use a resized version of it for the painting.
Since you have at least three times the same widget, you should create a custom class that implements it and reuse it.
1/5