I just created a resource file for my project, which got 5 prefixes (Window, background, etc).
My main problem is that, when using the Qt Designer, I go to stylesheet, open it up, Add resource -> background-image.
Unfortunately my picture is way too big for my window, and I can't seem to put it to scale using designer.
After reading some topics on the forums, I have tried to put this in the "stylesheet edit" :
background-image: url(:/background/Backgrounds/Fondecran1.jpg) 0 0 0 0 stretch stretch;
in place of
background-image: url(:/background/Backgrounds/Fondecran1.jpg);
Can anyone help me put it to scale ? Is there a way it can "adapt" as well as it can to changes in the window size ?
Thank you all in advance for your answers.
Instead you may need to use border-image
.
Look into the below content in the link provided.
A background-image does not scale with the size of the widget. To provide a "skin" or background that scales along with the widget size, one must use border-image. Since the border-image property provides an alternate background, it is not required to specify a background-image when border-image is specified. In the case, when both of them are specified, the border-image draws over the background-image.
http://doc.qt.io/qt-5/stylesheet-customizing.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With