My button's color seems transparent but why?
-
I'm using QTDesigner 5.15.8 and trying to color buttons.
Here is a screenshot of my problem.
I have inserted one button and frame on my mainwindow.
Here is the stylesheet code of mainwindowQPushButton{ background-color: red; } QFrame{ background-color: red; }
They are same but as you see they look different. I couldnt find why it happened but it happens even if I created a new project...
-
I'm using QTDesigner 5.15.8 and trying to color buttons.
Here is a screenshot of my problem.
I have inserted one button and frame on my mainwindow.
Here is the stylesheet code of mainwindowQPushButton{ background-color: red; } QFrame{ background-color: red; }
They are same but as you see they look different. I couldnt find why it happened but it happens even if I created a new project...
-
It's the gradient from the fusion style what you're seeing here I would guess.
-
@Pl45m4
On my previous project I can do what I want. I can add a new pushbutton and can color with stylesheet to whatever color I want...
But on newer project I cant do .... -
I found the solution. The reason is border....
Thanks for all...~~Warning: If you only set a background-color on a QPushButton, the background may not appear unless you set the border property to some value. This is because, by default, the QPushButton draws a native border which completely overlaps the background-color. For example,
QPushButton { background-color: red; border: none; }
See Customizing QPushButton for an example. ~~