'pyqt5 2nd window not loading correctly
When I try to load my 2nd window it is giving me a small blank window without any of my setup from the UI file. It is closing the Main welcome window just fine, but the window with all the forms and setup it isn't loading.
class AppManager(QMainWindow):
def __init__(self):
super(AppManager, self).__init__()
self.Main = Main()
self.FN5 = FN5()
self.Main.start.clicked.connect(self.chooseLine)
self.Main.show()
def chooseLine(self):
if self.Main.sd1.count(self.Main.line_combobox.currentText()) and self.Main.shift1.isChecked():
self.FN5.show()
self.Main.close()
1st window
class Main(QMainWindow):
def __init__(self):
super(Main, self).__init__()
self.sd1 = ["FN05"]
self.sd2 = ["FN01", "FN02", "FN03", "FN04"]
self.ps1 = ["FN06", "FN07", "FN08", "FN09", "FN10"]
self.fn_Line = []
for x in self.sd1:
self.fn_Line.append(x)
for x in self.sd2:
self.fn_Line.append(x)
for x in self.ps1:
self.fn_Line.append(x)
self.fn_Line.sort()
uic.loadUi("finishing.ui", self)
self.line_combobox = self.findChild(QComboBox, "FN_Line_comboBox")
self.start = self.findChild(QPushButton, "pushButton_begin")
self.shift1 = self.findChild(QRadioButton, "radioButton_1")
self.line_combobox.addItems(self.fn_Line)
self.fn_Line_comboBox.setCurrentIndex(-1)
2nd window
class FN5(QMainWindow):
def __init__(self):
super(FN5, self).__init__()
self.window = QMainWindow()
self.ui = Ui_Fin5()
self.ui.setupUi(self.window)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
