May 2019
Intermediate to advanced
542 pages
13h 37m
English
For developers who have worked with web technologies, styling an application using palette, brush, and color objects may seem verbose and unintuitive. Fortunately, Qt offers you an alternative known as QSS, which is very similar to the Cascading Style Sheets (CSS) used in web development. It is an easy way to apply some simple changes to our widgets.
You can use QSS as follows:
stylesheet = """ QMainWindow { background-color: black; } QWidget { background-color: transparent; color: #3F3; } QLineEdit, QComboBox, QCheckBox { font-size: 16pt; }""" self.setStyleSheet(stylesheet)
Here, a style sheet is just a string containing style directives, which we can assign to a widget's styleSheet ...
Read now
Unlock full access