Solved Set transparent to image in frame.
-
I have a frame where I've set background image to it and added buttons inside the frame, now I need to decrease my background's image opacity it is two strong in colour. I need to set that in style sheet.
Please help me out.
-
@Vineela Hi, can you give code where you set background for frame. It can more help.
-
@Bondrusiek
added this on my edit style sheet for QFrame
background-image: url(:/images/blue2.jpg); -
It is not a big issue. Go to the settings, there you can change the background. You can take help from a Facebook blog or watch a video about this topic. It will help to solve the problem.
-
@Vineela Maybe try to use opacity property. For example:
"background-image: url(:/images/blue2.jpg); opacity: 127;"
In docs:
*The opacity for a widget. Possible values are from 0 (transparent) to 255 (opaque). For the moment, this is only supported for tooltips.If this property is not specified, it defaults to the value specified by the current style for the SH_ToolTipLabel_Opacity style hint.
Example:
QToolTip { opacity: 223 }*
https://doc.qt.io/archives/qt-4.8/stylesheet-reference.html -
@joshep if i knew that means y will i ask her, if someone answers here it may help others too.
-
@Bondrusiek nope my image is still like that only it didn't get transparent.
-
Hii . Try to change the image as transparent in online https://onlinepngtools.com/create-transparent-png
and then you may try it here in codesetStyleSheet("background:transparent"); setAttribute(Qt::WA_TranslucentBackground,true);
-
@sankarapandiyan how can i do that in style sheet than in cpp file this is only QT Designer no coding needed so.
-
@Vineela
Hi
The easiest way is as @sankarapandiyan says.
Make is semi transparent in online editor and
then set on frame.
As far as i know, you cannot control transparency for background image using stylesheets. -
@mrjj Sure ill try it. Thank you .
-
Thank you all for your responses it worked. :D
-
@Vineela Can please tell how to do it?