Python/PyQt4: How do you find the SIZE of a monitor (in inches)?

拟墨画扇 提交于 2019-12-01 21:16:12

try using the QDesktopWidget's width() and height() to get the width and height respectively. Class reference at QDesktopWidget Class Reference, this will give you the screens size in pixels and then use QX11Info.appDpiX, this will give you the DPI in pixels per inch. Use both the above info to calculate the screen size in inches.

PS: The width() returns the union width, so in case you have multiple screens, it will return union width of all the screens.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!