Unsolved OPACITY OF QSTACKEDWIDGET
-
Hi, I have a stackedwidget on a mainwindo w . I have set a background image on the main window using the setpalette() function. I have been trying to set the stylesheet of the stackedwidget's page so as the color on it will reflect the image of the mainwindow. I used set window opacity(0.2); it didn't work. Thanks as you help
-
Hi
you can trystackedWidget->setStyleSheet("QWidget {background-color: transparent;}");
-
@mrjj perhaps this image will show you want I want to do
There's a background image and the stackedwidget is with a light blue color that is transparent
-
Hi
I dont see image ?
found it
-
Hi
well you can do
You might have to target the pages by name as to avoid any sub child widgets being transparent also.
-
@mrjj if I use the code you gave above and I target pages
ui->page->setStyleSheet("QWidget {background-color : transparent;}");It removes the color on the page of the stacked widget. What I want is there should be a color on the stacked widget page that we can still see through it to see the mainwindow's background image.link = ("https://www.datafilehost.com/d/9aab19c5")
-
@gblessed
Hi
Just make the color semi transparent then ?
See image. -
@mrjj I can't find the image
-
@gblessed
You dont see ?
-
@mrjj I can see now. How do you set it to semi-transparent, may be a line of code to set a color and make it semi-transparent.
-
@gblessed
The code is shown ?
the last part of RGB statement is alpha value.
stackedWidget->setStyleSheet("QWidget {background-color: rgb(0, 85, 255, 50);}"); -
@mrjjso for the above. it worked perfectly. Thanks for your time sir
-
Hi,
Just a small unrelated note, please stop using all caps title for your questions. In written language such sentences are considered shouting and rude.