I am trying to set a button to a button so that it does not have a limit, but it seems to be missing the limit Does the button make the clickable without a better way of getting no limits?
button = qtigui.quipushbutton (todo, self) button.Move (0, I * 32) button .SetfixSysize (200, 32) button. SetCheckable (True) button.setStyleSheet ("QPushButton {background: RGB (75, 75, 75); color: RGB (255, 255, 255); text-line: left; font-size: 12pt; boundary: none; } ")
EDIT: WHOPS, it has just been seen that this question / Python There is a question about (and not, QT / C ++), maybe my answer helps in any way ..
Just tried to do it, and it works for me ... Here is the code I used:
#include & lt; QtGui / QApplication & gt; # Include & lt; QtGui / QPushButton & gt; Int main (int argc, char * argv []) {Q Application A (argc, argv); QWidget w; QPushButton * button = new QPushButton ("I'm toggle", & amp; w); Button & gt; SetFixedSize (20032); Button & gt; SetCheckable (true); Button-> Set Style Sheet ("QPushButton {\ background: rgb (75, 75, 75); \ color: rgb (255, 255, 255); \ text-align: left; \ font-size: 12pt; \ border: none; \} \ Q Push Button: Check {\ Background: RGB (105, 105, 105); \} \ "); W.show (); Back a.exec (); }
Notice I added an additional CSS rule for the checked buttons, so it appears if any button is checked or not. Are you sure your buttons do not work, or maybe, do not you see that they are working ?!
EDIT2: If this does not work for you, then you should only setFlat (True)
, and use additional CSS rules to fix the colors (like my example In).
Comments
Post a Comment