Ok, so I have the background image in a resource file.

I have a widget as main window and on top of that, a MultiPageWidget. ( all built with the designer ).

Now, using a stylesheet I haven't managed to set the window ( widget ) background so that the surrounding multipagewidget`s area ( the visible place belonging to the main window widget that is behind ) would have the specified background-image.

After trying all the possibilities, I found a workaround... actually not a workaround... just something to make it work :P and it involves the following code, and not css ( what I wanted ).

Qt Code:
  1. QPixmap bg(":/images/background.png");
  2. QPalette p(palette());
  3. p.setBrush(QPalette::Background, bg);
  4. setAutoFillBackground(true);
  5. setPalette(p);
To copy to clipboard, switch view to plain text mode 

This is quite a standard way of setting an image for background, but I wanted the clean css way, not the coded way...

p.s.: This way It had a nice side-effect by displaying the background image trough the other controls like QGroupBox and QLabel that were contained in the MultiPageWidget. I expected them being opaque instead of transparent, but that will do.

The CSS I used in trying to set the background image was simple:
Qt Code:
  1. MainWindow {
  2. background-image: url(:/images/background.png);
  3. }
To copy to clipboard, switch view to plain text mode 

If I use a background-color: red; for example... I get the desired effect, only with a color, not an image.

Hope I was explicit enough.

Any ideeas?