Hi everyone,
For setting an image as the background image of my QWidget I am using the following code-
this->setAutoFillBackground(true);
palette.
setBrush(this
->backgroundRole
(),
QBrush(QImage("MyImage.jpg")));
this->setPalette(palette);
this->setAutoFillBackground(true);
QPalette palette = this->palette();
palette.setBrush(this->backgroundRole(), QBrush(QImage("MyImage.jpg")));
this->setPalette(palette);
To copy to clipboard, switch view to plain text mode
Now I want to reset my Palette and make my QWidget appear completely Black. How do I do that?
I tried using
QPixMap and QPixMap::fill(Qt::Black)
and then setting this PixMap to my Palette, but it didn't work
Bookmarks