[SOLVED] Selecting a Tab in Code
General and Desktop
4
Posts
3
Posters
21.8k
Views
1
Watching
-
wrote on 11 Jul 2011, 11:07 last edited by
Hi, I have a QTabWidget in which I have two tabs. The first I use for the application's general UI and the other for errors. When an error occurs I would like to active this tab to bring these errors to the user's attention. However I cannot see, nor find, anything that allows me to do this, so I thought I'd ask here. I am using Qt 4.7.2 if that helps.
-
wrote on 11 Jul 2011, 11:19 last edited by
Try changing current tab using setCurrentIndex(int) function.
-
wrote on 11 Jul 2011, 11:22 last edited by
You can use "tab index":http://doc.qt.nokia.com/4.7/qtabwidget.html#currentIndex-prop to do that. Just call @setCurrentIndex(neededIndex);@
-
wrote on 11 Jul 2011, 11:41 last edited by
Thanks for the replies and needless to say it was exactly what I was looking for. Just as well no one can't see how embarrassed I look!
4/4