class MainWindow(QWidget): def __init__(self): super(MainWindow, self).__init__() uic.loadUi("driveSelection.ui", self) self.setWindowTitle("Welcome Screen") self.setWindowIcon(QIcon("Picture.png")) self.backButton.clicked.connect(self.gotoScreen) def gotoScreen(self): pathselection1 = pathSelection1() widget.addWidget(pathselection1) widget.setCurrentIndex(widget.currentIndex() + 1) if __name__ == "__main__": app = QApplication(sys.argv) widget = QtWidgets.QStackedWidget() mainwindow = MainWindow() widget.addWidget(mainwindow) widget.setFixedHeight(300) widget.setFixedWidth(500) widget.show() sys.exit(app.exec_())
if __name__ == "__main__": app = QApplication(sys.argv) window = MainWindow() window.show() sys.exit(app.exec_())
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)