PyQt5 QCalendarWidget – Device Pixel Ratio Float
In this article we will see how we can get device pixel ratio, float value of the QCalendarWidget. The device pixel ratio is the ratio between physical pixels and logical pixels of the calendar. Common values are 1 for normal-dpi displays and 2 for high-dpi “retina” displays, for some devices it is in decimal values like 1.1, 1.2 etc .
In order to do this we will use devicePixelRatioF method with the QCalendarWidget object.
Syntax : calendar.devicePixelRatioF()
Argument : It takes no argument
Return : It return float
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