Code:
standard_button = '''QPushButton {{
color: rgb{};
background-color: rgb{};
border-bottom-left-radius: {}px;
border-bottom-right-radius: {}px;
border-top-left-radius: {}px;
border-top-right-radius: {}px;
}}
QPushButton:hover {{
background-color: rgb{};
}}
QPushButton:checked {{
background-color: rgb{};
color: rgb{};
}}
QPushButton:disabled {{
color: rgb{};
background-color: rgb{};
border: none;
}}'''
I can't remember if there's a good reason why I used individual corner radius %s vs just a general border-radius setting. Swap out the {} for values and that's straight out of my code.
I didn't use the setPalette or .setObjectName methods for any of my widgets - again, can't remember if that was for a reason or if I just never saw those methods. I created
this library to let me group widgets and make it easier to manage colour schemes on different team pages, etc. It's super amateur and I'm sure Qt has a way of doing the same thing (possibly .setObjetcName), but it was an easier "python" way for me to handle it.