Skip to content

Commit 01a245b

Browse files
done V1.2 fix bug and add icon
1 parent 51f32f3 commit 01a245b

File tree

5 files changed

+8
-4
lines changed

5 files changed

+8
-4
lines changed

.idea/workspace.xml

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

SIM_GUI_exe.zip

13.3 KB
Binary file not shown.

__pycache__/main.cpython-36.pyc

119 Bytes
Binary file not shown.

icon.ico

66.1 KB
Binary file not shown.

main.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import time
77
import os
88
from PyQt5.QtWidgets import QApplication, QMainWindow, QFileDialog
9-
from PyQt5.QtGui import QFont
9+
from PyQt5.QtGui import QIcon
1010

1111

1212
class MainWindow(QMainWindow, UI.Ui_MainWindow):
@@ -17,6 +17,8 @@ def __init__(self):
1717

1818
def getExistingDirectory(self):
1919
fileDirectory = QFileDialog.getExistingDirectory(self, "选则文件夹", "/")
20+
if not os.path.isdir(fileDirectory):
21+
return
2022
self.filePathEdit.setText(fileDirectory)
2123
self.changeNameButton.setEnabled(True)
2224
self.startButton.setEnabled(False)
@@ -54,10 +56,12 @@ def startRunSIM(self):
5456
self.resultText.append("共耗时%.6fs" % (endTime - startTime))
5557
self.startButton.setEnabled(False)
5658
self.changeNameButton.setEnabled(False)
59+
self.filePathEdit.setText('请选择文件路径')
5760

5861

5962
if __name__ == '__main__':
6063
app = QApplication(sys.argv)
64+
app.setWindowIcon(QIcon('icon.ico'))
6165
mainWindow = MainWindow()
6266
mainWindow.show()
6367
sys.exit(app.exec_())

0 commit comments

Comments
 (0)