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. Note that once you do this, any INPUT and THEME keys in the .ini will be ignored.
The Qt Style Sheets Reference and the Style Sheet Syntax and the Style Sheet Examples are good references to use when creating your own stylesheets.
Note
If there is an error in the stylesheet syntax, no warning is issued, it is just ignored. So don’t forget the ; at the end of each setting. And do not accidentally use any backslashes it will break the whole file.
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 or RGBA color model. RGB is Red, Green, Blue and A means Alpha or transparency.
rgb(0, 0, 255) Blue
rgba(0, 0, 255, 25%) Light Blue
Examples¶
/* Set the background color for all QPushButtons, border is required * /
QPushButton {
background-color: rgba(224, 224, 224, 50%);
border: 1px;
}
/* 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;
}