StyleSheet¶
You can use your own qss style sheet by creating a valid qss file in the configuration directory and setting it in the INI Settings
The Qt Style Sheets Reference and the Style Sheet Syntax are good references to use when creating your own stylesheet.
Note
If there is a error in the stylesheet syntax no warning is issued, it’s just ignored. So don’t forget the ; at the end or each setting.
Warning
If you only set a background-color on a QPushButton, the background may not appear unless you set the border property to some value even if border is set to none.
Colors¶
Most colors can be specified using either the RGB color model or the RGBA color model. RGB is Red, Green, Blue and RGBA is Red, Green, Blue, Alpha.
rgb(0, 0, 255) Blue
rgba(0, 0, 255, 25%) Light Blue
Examples¶
/*Set the background color for all QPushButtons*/
QPushButton{
background-color: rgba(224, 224, 224, 50%);
}
/*Set the background color and style for all QPushButtons when Pressed*/
QPushButton:pressed{
background-color: rgba(192, 192, 192, 100%);
border-style: inset;
}
/*Set settings for a QPushButton named exit_pb*/
QPushButton#exit_pb{
border: none;
background-color: rgba(0, 0, 0, 0);
}
/*Using sub controls*/
QAbstractSpinBox::up-button {
min-width: 30px;
}
/*Combining sub controls and state*/
QTabBar::tab:selected {
background: lightgray;
}