只需要在程序主函数入口处,QApplication
运行前,加入一下代码
from PyQt5 import QtCore
QtCore.QCoreApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling)
例如:
if __name__ == '__main__':
from PyQt5 import QtCore
QtCore.QCoreApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling)
app = QtWidgets.QApplication(sys.argv)
myshow = Pyqt5_Serial()
myshow.show()
sys.exit(app.exec_())