Просмотр исходного кода

尝试解决 Read_Timing_Constraint 闪一下的问题

mrh 3 лет назад
Родитель
Сommit
ccb492b27a
2 измененных файлов с 4 добавлено и 6 удалено
  1. 4 4
      ui/AddFile.py
  2. 0 2
      ui/Read_Timing_Constraint.py

+ 4 - 4
ui/AddFile.py

@@ -48,19 +48,19 @@ class AddPathWindow(Ui_AddPathWindow, QDialog):
     def __init__(self, parent, path) -> None:
         super().__init__(parent)
         self.setupUi(self)
-        self.setWindowTitle("Add Path")
         self.file_suffix = ["All Directories(*.*)"]
         self.init(parent, path)
-        self.fileTable.clearSelection()
-        self.fileTable.setCurrentIndex(QModelIndex())
     
     def init(self, parent, path):
+        self.setWindowTitle("Add Path")
         self.Combobox_FileType.addItems(self.file_suffix)
         self.Combobox_FileType.currentIndexChanged.connect(lambda index:self.show_file_list())
         self.path_obj = PathObject(path)
         self.bnt_Apply.clicked.connect(self.apply)
         self.bnt_OK.clicked.connect(self.click_ok)
         self.init_file_browser(path)
+        self.fileTable.clearSelection()
+        self.fileTable.setCurrentIndex(QModelIndex())
         self.move(parent.x()+(parent.width()-self.width())/2 + self.width()*0.8,parent.y()+(parent.height()-self.height())/2)
         self.show()
     
@@ -155,9 +155,9 @@ class AddPathWindow(Ui_AddPathWindow, QDialog):
 class AddFileWindow(AddPathWindow):
     def __init__(self, parent, path) -> None:
         super().__init__(parent, path)
-        self.setWindowTitle("Add File")
     
     def init(self,parent, path):
+        self.setWindowTitle("Add File")
         self.file_type = [".v", ".sv", ".f", ".lst", ".list"]
         self.file_suffix = ["Supported Files(%s)" % " ".join(['*'+str(s) for s in self.file_type]), "All Files(*.*)"]
         super().init(parent, path)

+ 0 - 2
ui/Read_Timing_Constraint.py

@@ -11,8 +11,6 @@ class ReadTimeWindow(AddFileWindow):
         self.setWindowTitle("Read Timing Constraint")
         self.mainWindow = parent
         self.move(parent.x()+(parent.width()-self.width())/2,parent.y()+(parent.height()-self.height())/2)
-        # 调整对话框大小以适应内容
-        self.adjustSize()
         
     def init(self,parent, path):
         self.file_type = [".sdc"]