Customization of push button
-
@J.Hilk said in Customization of push button:
QPushButton{border: none;}
AFAIK border: none; will not change anything
-
@J.Hilk said in Customization of push button:
QPushButton{border: none;}
AFAIK border: none; will not change anything
-
Just checked it, it does exactly what the OP want to, it removes the border/bulge of the default QPushButton
-
Hi all, I have one more question. How can I let the buttons pushed down when mouse hovers on it, like below:
The arrow button is pushed down when my mouse hovers on it.
Could you please give some hints on what method to use? There's no hover or enter event for a button.Aside: When border is set to none, there would never appear a border even when I pused on it, which is not what I meant to do. Confused!
-
Hi all, I have one more question. How can I let the buttons pushed down when mouse hovers on it, like below:
The arrow button is pushed down when my mouse hovers on it.
Could you please give some hints on what method to use? There's no hover or enter event for a button.Aside: When border is set to none, there would never appear a border even when I pused on it, which is not what I meant to do. Confused!
QStyleSheet is also here your friend. For example:
QPushButton:hover{background-color:red;}
-
QStyleSheet is also here your friend. For example:
QPushButton:hover{background-color:red;}
-
@J.Hilk
Oh, yes! Please forgive me, I'm quite new about the usage of stylesheet! So I need to set different stylesheet for normal, hover and pushed status.that would be correct:
a small example:
ui->myButton->setStyleSheet( //Default Button "QPushButton{border:none; color: black; background-color:transparent;}" //When mose over "QPushButton:hover{border: 1px solid grey; color: red; background-color:white;}" //When checked "QPushButton:checked{border: 1px solid black; color: white; background-color:red;}" );