1.首先引入模块
from PyQt5.QtWidgets import QApplication
##添加第一行代码即可解决
QApplication.setAttribute(Qt.AA_EnableHighDpiScaling)#
app = QtWidgets.QApplication(sys.argv)
mainwindow = QtWidgets.QMainWindow()
ui = Ui_MainWindow()
ui.setupUi(mainwindow)
mainwindow.show()
sys.exit(app.exec_())
1 条评论