fix: repeat tab initialization

This commit is contained in:
283375 2023-09-01 04:06:02 +08:00
parent 93bea4b88a
commit 2898e99cdf

View File

@ -23,16 +23,16 @@ class MainWindow(Ui_MainWindow, QMainWindow):
super().__init__(parent)
self.setupUi(self)
currentIndex = self.tabWidget.currentIndex()
ocrTabIndex = self.tabWidget.indexOf(self.tab_ocr)
self.tabWidget.removeTab(ocrTabIndex)
self.tab_ocr.deleteLater()
# currentIndex = self.tabWidget.currentIndex()
# ocrTabIndex = self.tabWidget.indexOf(self.tab_ocr)
# self.tabWidget.removeTab(ocrTabIndex)
# self.tab_ocr.deleteLater()
# if OCR_ENABLED_FLAG:
# self.tab_ocr = TabOcr(self.tabWidget)
# else:
# self.tab_ocr = TabOcrDisabled(self.tabWidget)
# self.tab_ocr.contentLabel.setText(OCR_ERROR_TEXT)
self.tab_ocr = TabOcrEntry(self.tabWidget)
self.tabWidget.insertTab(ocrTabIndex, self.tab_ocr, "")
self.tabWidget.setCurrentIndex(currentIndex)
self.retranslateUi(self)
# self.tab_ocr = TabOcrEntry(self.tabWidget)
# self.tabWidget.insertTab(ocrTabIndex, self.tab_ocr, "")
# self.tabWidget.setCurrentIndex(currentIndex)
# self.retranslateUi(self)