def qwtScreenResolution(): screenResolution = QSize() if not screenResolution.isValid(): desktop = QApplication.desktop() if desktop is not None: screenResolution.setWidth(desktop.logicalDpiX()) screenResolution.setHeight(desktop.logicalDpiY()) return screenResolution