diff --git a/Combobox.py b/Combobox.py index 649cc4f..4299c92 100644 --- a/Combobox.py +++ b/Combobox.py @@ -1,5 +1,5 @@ -from PyQt5.QtWidgets import QComboBox,QListView -from PyQt5.QtCore import pyqtSignal +from PyQt6.QtWidgets import QComboBox, QListView +from PyQt6.QtCore import pyqtSignal class ComboBox(QComboBox): diff --git a/helpAbout.py b/helpAbout.py index 670959a..ef55347 100644 --- a/helpAbout.py +++ b/helpAbout.py @@ -26,7 +26,7 @@ def strAbout():
'''+tr("About")+''':

-'''+tr("Release with")+" Python" +str(py_version[0]+py_version[1]/10)+ ''' + PyQt5

+'''+tr("Release with")+" Python" +str(py_version[0]+py_version[1]/10)+ ''' + PyQt6

'''+parameters.appName+" "+tr("is a Open source project created by")+'''

''' +tr("Author")+":"+parameters.author+'''

diff --git a/kflash_gui.py b/kflash_gui.py index cd10ed8..556cf85 100644 --- a/kflash_gui.py +++ b/kflash_gui.py @@ -10,12 +10,13 @@ import json, zipfile, struct, hashlib # from COMTool.wave import Wave -from PyQt5.QtCore import pyqtSignal,Qt -from PyQt5.QtWidgets import (QApplication, QWidget,QToolTip,QPushButton,QMessageBox,QDesktopWidget,QMainWindow, - QVBoxLayout,QHBoxLayout,QGridLayout,QLabel, - QLineEdit,QGroupBox,QSplitter,QFileDialog,QCheckBox, +from PyQt6.QtCore import pyqtSignal +from PyQt6.QtWidgets import (QApplication, QWidget, QToolTip, QPushButton, QMessageBox, QMainWindow, + QVBoxLayout, QHBoxLayout, QGridLayout, QLabel, + QLineEdit, QGroupBox, QFileDialog, QCheckBox, QProgressBar) -from PyQt5.QtGui import QIcon,QFont,QTextCursor,QPixmap +from PyQt6.QtGui import QIcon, QFont, QPixmap + import serial import serial.tools.list_ports import threading @@ -381,7 +382,7 @@ def initWindow(self): self.setWindowTitle(parameters.appName+" V"+str(helpAbout.versionMajor)+"."+str(helpAbout.versionMinor)) icon = QIcon() print("icon path:"+self.DataPath+"/"+parameters.appIcon) - icon.addPixmap(QPixmap(self.DataPath+"/"+parameters.appIcon), QIcon.Normal, QIcon.Off) + icon.addPixmap(QPixmap(self.DataPath+"/"+parameters.appIcon), QIcon.Mode.Normal, QIcon.State.Off) self.setWindowIcon(icon) if sys.platform == "win32": ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(parameters.appName) @@ -444,10 +445,11 @@ def portComboboxClicked(self): def MoveToCenter(self): qr = self.frameGeometry() - cp = QDesktopWidget().availableGeometry().center() + screen = QApplication.primaryScreen() + cp = screen.availableGeometry().center() qr.moveCenter(cp) self.move(qr.topLeft()) - + def changeFunc(self): if self.burning or self.packing or self.erasing: self.hintSignal.emit(tr("Busy"), tr("Busy")) @@ -579,10 +581,10 @@ def erase(self): self.eraseStatus.setText("%s" %("#0eb40e", tr("Preparing Erase") )) eraseThread = threading.Thread(target=self.eraseProcess, args=(addr, length, config['dev'], config['baud'], config['board'], config['color'], config['slow'])) - eraseThread.setDaemon(True) + eraseThread.daemon = True eraseThread.start() eraseStatusThread = threading.Thread(target=self.updateEraseStatus, args=(length_text, unit, eraseTimeEstimate)) - eraseStatusThread.setDaemon(True) + eraseStatusThread.daemon = True eraseStatusThread.start() def setEraseButton(self, cancel): @@ -874,7 +876,7 @@ def packFiles(self): # pack and save t = threading.Thread(target=self.packFileProccess, args=(files, fileName_choose,)) - t.setDaemon(True) + t.daemon = True t.start() def packFileProccess(self, files, fileSaveName): @@ -975,7 +977,7 @@ def mergeBin(self): # pack and save t = threading.Thread(target=self.mergeBinProccess, args=(files, fileName_choose,)) - t.setDaemon(True) + t.daemon = True t.start() def mergeBinProccess(self, files, fileSaveName): @@ -1060,7 +1062,7 @@ def detectSerialPort(self): if not self.isDetectSerialPort: self.isDetectSerialPort = True t = threading.Thread(target=self.detectSerialPortProcess) - t.setDaemon(True) + t.daemon = True t.start() def showCombobox(self): @@ -1320,7 +1322,7 @@ def download(self): self.progressHint.setText(hint) # download burnThread = threading.Thread(target=self.flashBurnProcess, args=(config['dev'], config['baud'], config['board'], config['sram'], fileType, filesInfo, self.progress, config['color'], config['slow'], config['iomode'])) - burnThread.setDaemon(True) + burnThread.daemon = True burnThread.start() def flashBurnProcess(self, dev, baud, board, sram, fileType, files, callback, color, slow, io_mode): @@ -1415,10 +1417,9 @@ def main(): app.setStyleSheet(qss) mainWindow.detectSerialPort() t = threading.Thread(target=mainWindow.autoUpdateDetect) - t.setDaemon(True) + t.daemon = True t.start() - sys.exit(app.exec_()) - + sys.exit(app.exec()) if __name__ == '__main__': main() diff --git a/requirements.txt b/requirements.txt index 9c033b8..ad85653 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ bs4>=0.0.1 pyelftools>=0.28 pyinstaller>=5.1 -PyQt5>=5.15.7 +PyQt6>=6.8.0 pyserial>=3.5 requests>=2.28.0 tinyaes>=1.0.3