Hi everyone,

For setting an image as the background image of my QWidget I am using the following code-

Qt Code:
  1. this->setAutoFillBackground(true);
  2. QPalette palette = this->palette();
  3. palette.setBrush(this->backgroundRole(), QBrush(QImage("MyImage.jpg")));
  4. 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