Unsolved Can I set QLabel background image using setProperty()?
-
Hello Qt'perts,
Is there a way to set a QLabel background-image programmatically from a pixmap, eg using QLabel::setProperty(). I realize it can be set from a path using setStylesheet() but in this case I only have access to the actual QPixmap and not the resource path. Any code examples as to how to do this would be much appreciated.
Regards,
Eric G
Peloton Technology -
Hi,
Why not just set an image on the QLabel ?
-
@SGaist I cannot set the label's pixamp because it is being used to display text and I want to add the image as background to the text.
-
Since you can't do it from a style sheet, draw your text on the pixmap before setting it on the label. That would likely be simpler.