I'm trying to set a style to a button so that it has no border, but it seems the lack of border then makes the button non-clickable. Is there a better way of getting no border?
button = QtGui.QPushButton(todo, self)
button.move(0, i * 32)
button.setFixedSize(200,32)
button.setCheckable(True)
button.setStyleSheet("QPushButton { background: rgb(75, 75, 75); color: rgb(255, 255, 255); text-align: left; font-size: 12pt; border: none;}")
EDIT: WHOOPS, just noticed this is a Question regarding Qt/Python (and not Qt/C++), well maybe my answer helps anyways..
Just tried it, and it works for me... Here is the code i used:
notice i added a additional CSS rule for checked buttons, so it gets visible if a Button is checked or not. Are you sure your buttons dont work, or could it be, that you just dont see that they are working ?!
EDIT2: If it doesnt work for you, you could just use
setFlat(True)
, and use additional CSS rules to fix the colors (like in my example).