May 2019
Intermediate to advanced
542 pages
13h 37m
English
The first thing we'll tackle is the font. Every QWidget class has a font property, which we can either set in the constructor or by using the setFont() accessor. The value of font must be a QtGui.QFont object.
Here is how you can create and use a QFont object:
heading_font = qtg.QFont('Impact', 32, qtg.QFont.Bold) heading_font.setStretch(qtg.QFont.ExtraExpanded) heading.setFont(heading_font)
A QFont object contains all the attributes that describe the way text will be drawn to the screen. The constructor can take any of the following arguments:
Read now
Unlock full access