Hi all,
I am trying to put a background image to a qmainwindow (or better a widget inheriting from qmainwindow). What I know is
window->setStyleSheet("backgour-image:url(myimage.jpg);");
but this somehow tries to "paint" the image on all the widgets which are children to window.
What I WANT to do is is having each widget paint its own space and then the parent window paint any space not taken up by a child.
To make it more precise. Assume that in the constructor of window we have the following:
QPushButton * button1 = new QPushButton("Button 1", this);
QPushButton * button2 = new QPushButton("Button 2", this);
QVBoxLayout * layout = new QVBoxLayout(this);
layout->addWidget(button1);
layout->addWidget(button2);
this->setLayout(this->layout);
/* code to add background image */
If i write this->setStyleSheet("background-image:url(myimage.jpg);"), it will try to put my image on any child of this. What i want is having button1 and button2 having their classical view and in the space between them that layout gives them, myimage is painted (of course in any other place that window might get.
I am pretty sure my question is very simple but i hope that someone takes some time to write me
Thank you very much
Bookmarks