How to set background image with no-repeat (without using CSS)
I currently have code that sets a widgets background to a desired image. However, by default it is tiling the image. I'm trying to make it so that it does not repeat. I was able to use CSS stylesheet's to do this, but it ended up lagging my program on load. Therefore, I decided to use a different method. Below is the code I have so far, and if anyone can help me figure out how to make it not repeat the image, I would appreciate it:
Code:
this->setPalette(p);
this->setAutoFillBackground(true);
Re: How to set background image with no-repeat (without using CSS)
Is it a custom widget? Maybe you can paint it yourself?
Re: How to set background image with no-repeat (without using CSS)
Although a weak solution, this is what got the job done:
Through Designer:
I simply created a QLabel and set the Pixmap of the label to be my background image. I then made sure that this new label was moved to the back, so that it was behind all other form items.
Re: How to set background image with no-repeat (without using CSS)
QT cannot do too much.
Cannot move icon/background image/border image to a fixed position.
And now, it stop you do it outside a customer widget.
So the only way is to paint by yourself, perfect.