Remove gradient from QPushButton
-
This question might sound a bit stupid, but I was unable to find any proper solution for it.
I have a QPushButton. When I directly give it style using:
myButton->setStyleSheet();
I get the required color in it. But, when I set its object name and then apply stylesheet to that object name in my qss file, I get a default gradient and the color is also changed a bit. I am using the same bgr values in both. Is there any way around it? I tried the setAutoFillBackground() property, but it still doesn't work.Here is my qss code:
#myButton {
background-color: rgb(199, 255, 155);
border: 1px solid black;
} -
-
-
This question might sound a bit stupid, but I was unable to find any proper solution for it.
I have a QPushButton. When I directly give it style using:
myButton->setStyleSheet();
I get the required color in it. But, when I set its object name and then apply stylesheet to that object name in my qss file, I get a default gradient and the color is also changed a bit. I am using the same bgr values in both. Is there any way around it? I tried the setAutoFillBackground() property, but it still doesn't work.Here is my qss code:
#myButton {
background-color: rgb(199, 255, 155);
border: 1px solid black;
}This is how I got rid of the gradient:
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 your_color, stop: 1 your_color); -