The method of obtaining the resolution of display by pyqt5


The code is as follows

import sys
			from PyQt5.QtWidgets import QApplication, QWidget
			class Example(QWidget):
			def __init__(self):
			#Interface drawing to initui method
			def initUI(self):
			self.desktop = QApplication.desktop()
			#Get display resolution size
			self.screenRect = self.desktop.screenGeometry()
			self.height = self.screenRect.height()
			self.width = self.screenRect.width()
			#Show window
			if __name__ == '__main__':
			#Create applications and objects
			app = QApplication(sys.argv)
			ex = Example()

The above pyqt5 method to get the resolution of the display is all the content shared by the editor. I hope it can give you a reference, and I hope you can support developepaer more.

Recommended Today

PDO data object in PHP

PDO: PHP data object: the data object of PHP.PDO is a database operation tool class!1. It can operate many kinds of databases, such as mysql, Oracle, Sybase….2. It has more functions to operate the database, such as transactions.3. It can operate all kinds of data, but it has the same syntax: that is to use […]