PyQt5 QSpinBox – Setting letter spacing
In this article we will see how we can set the letter spacing in the text of spin box, letter spacing is the distance(gap) in-between two consecutive letter. Spacing can be change by specifying the pixels or the percentage. In order to set the spacing using pixels we use
QFont.AbsoluteSpacing as type of spacing and for setting spacing using percentage we use
QFont.PercentageSpacing as the type of spacing.
In order to do this we use
setLetterSpacing method with the QFont object of the spin box
Syntax : font.setLetterSpacing(type, value)
Argument : It takes two argument, first is type of spacing and other is the floating value
Return : It returns None
Below is the implementation
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course