0

I would like to change the size of my background image so that it doesn't claim the full size of my label. e.g. in this case

enter image description here

the sun symbol is supposed to be shorter in length so it doesn't look that long and doesn't affect the text below. I placed the background with the setStyleSheet function and the text with the setText function. Is there a way to do so?

Schulp
  • 53
  • 5
  • What about `QLabel::setScaledContents(false)`? – vahancho Mar 23 '20 at 11:10
  • Unfortunately that doesn't change anything. – Schulp Mar 23 '20 at 11:18
  • What about two labels (aligned e.g. with a `QVBoxLayout`) where one shows the image and one the text? FYI: [QLabel::setPixmap()](https://doc.qt.io/qt-5/qlabel.html#pixmap-prop) and (maybe) [QPixmap::fromImage()](https://doc.qt.io/qt-5/qpixmap.html#fromImage). (You could pick the color of image from the bottom to set the appropriate background color for the text label. With this, it's probably hard to see the "fake".) ;-) – Scheff's Cat Mar 23 '20 at 11:44
  • Just FYI: [SO: Qt - How to create Image that scale with window, and keeps aspect ratio?](https://stackoverflow.com/a/42852010/7478597) – Scheff's Cat Mar 23 '20 at 11:51

0 Answers0