Set a stylesheet for a toggled button
-
Hi, so I wanna set a stylesheet everytime a button is toggled, but I can't seem to figure out how.
This is what I tried this so far:QPushButton::checked{ background-color: rgb(255, 170, 255); }
checked: rgb(255, 170, 255);
None of these work.
Just one
:
QPushButton:checked {........}
Also you probably need to set a custom border style to make your background color visible.
From documentation:
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
-
Just one
:
QPushButton:checked {........}
Also you probably need to set a custom border style to make your background color visible.
From documentation:
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