How to link a QPushButton to a tab of QTabWidget?
-
25-06-2021 - |
Question
I am using Qt to do a GUI program, so my problem is, I have made a homepage in my GUI program and I have some 4 tabs tab1,tab2,tab3,tab4 and I have made QPushbutton over at homepage. So can anyone tell me how can I link QPushButton to tab3 of QTabWidget so that when I click the button it should take me to tab 3. Thank you
Solution
First create a slot, what handles the buttons click event (Slots, QPushButton)
Then use the QTabWidgets setCurrentIndex function like yourTabWidget->setCurrentIndex(2);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow