PDA

View Full Version : simple question about QTabWidget



abrou
8th February 2008, 22:13
I have a list of things in another widget, and when the user selects it, I want the corresponding tab to show in my QTabWidget. So, basically I want to change which tab is showing without the user clicking on the tab. Is there a function that I can call to do this?
I thought the one below would do it, but it didn't seem to work.


void QTabWidget::setTabEnabled ( int index, bool enable )

Any suggestions?

Thanks!

jacek
8th February 2008, 22:18
Use QTabWidget::setCurrentWidget() or QTabWidget::setCurrentIndex().


P.S. You might find QSignalMapper useful.

abrou
8th February 2008, 22:27
Thank you! I'll try that!