I'd like to add an event to change the color of some elements in batches when I click the button in PyQt5. I'd like to change the color to a variable in the setStyleSheet, what should I do?
Below is the way I tried and failed.
setting_btn.setStyleSheet(
'QPushButton { color: black; background-color:{0}; border-radius: 5px;}'.format('#519AA4'),
'QPushButton:pressed { background-color: #305F65 }'
)