Unsolved Switching between stackedwidgets using ComboBox item click or selection
-
Hi, I want to use ComboBox to switch between stackedwidgets. Example is when the user select or click an item in the comboBox the user should be directed to a specific stackedwidget page. Below is what I have tried but it does not work, please any assistance would be appreciated.
self.ui.comboBox_73.currentIndexChanged.connect(self.report_page) def report_page(self): self.ui.stackedWidget.setCurrentWidget(self.ui.Second_Page)
-
@LT-K101 https://doc.qt.io/qt-5/qcombobox.html#currentIndexChanged has a parameter which you can use to activate specific widget (https://doc.qt.io/qt-5/qstackedwidget.html#currentIndex-prop).
Hint: you can connect the above signal to the above slot. -
@jsulm Thanks I used .activated() and it worked