Set Background-Image of QMainWindow without affecting the subordinate components as well!
-
Hello,
First I decided to set the background image of every Frame. But i determined that all components inside the frames were affected aswell. So the other way i tried was to set the Background image for the hole QMainWindow but i determined the same problem?How could i set the background image without affecting the subordinated components?
It should look like this,

but is looks like that, that everything includes the background double and triple times:

-
Hello,
First I decided to set the background image of every Frame. But i determined that all components inside the frames were affected aswell. So the other way i tried was to set the Background image for the hole QMainWindow but i determined the same problem?How could i set the background image without affecting the subordinated components?
It should look like this,

but is looks like that, that everything includes the background double and triple times:

You used stylesheet?
You need to specify the objectName of the object that should have your background-image.
Something like:this->setStyleSheet("QMainWindow#objectName { background-image: /path/to/img.png; }");Otherwise all childs will inherit this background too (if possible).
-
You used stylesheet?
You need to specify the objectName of the object that should have your background-image.
Something like:this->setStyleSheet("QMainWindow#objectName { background-image: /path/to/img.png; }");Otherwise all childs will inherit this background too (if possible).
@Pl45m4 Oh great now its working. So if i want to show any stylesheet e.g. only on one frame and not on his childs, i have to use that #Methode?
Thanks -
@Pl45m4 Oh great now its working. So if i want to show any stylesheet e.g. only on one frame and not on his childs, i have to use that #Methode?
Thanks@AlexKrammer said in Set Background-Image of QMainWindow without affecting the subordinate components as well!:
So if i want to show any stylesheet e.g. only on one frame and not on his childs, i have to use that #Methode?