qt - QPushButton dimensions change when Stylesheet is apllied -


when apply style sheet on qpushbutton dimensions change. style sheet declaration.

 qpushbutton {     background-color: rgb(175, 187, 199);    color: black;    border-width: 1px;    border-top: 1px solid white;    border-left: 1px solid white;    border-right: 1px solid grey;    border-bottom: 1px solid grey;    border-style: solid;    border-radius: 5;    padding: 3px;     padding-left: 5px;     padding-right: 5px;    font: 16px;    font-weight: bold; } 

image - before applying style sheet

image - after applying style sheet

how keep original button size?

based on comment below question: try add qualifier:

mydialog qpushbutton {     background-color: rgb(175, 187, 199);    color: black;    border-width: 1px;    border-top: 1px solid white;    border-left: 1px solid white;    border-right: 1px solid grey;    border-bottom: 1px solid grey;    border-style: solid;    border-radius: 5;    padding: 3px;     padding-left: 5px;     padding-right: 5px;    font: 16px;    font-weight: bold; } 

this should merged default style sheet (not override whole thing) , work on buttons need alter.

see documentation.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -