[Qt-interest] How to hide tabs in QTabWidget?

Tony Rietwyk tony.rietwyk at rightsoft.com.au
Fri Jan 30 00:51:22 CET 2009


Andy wrote:

> Tony Rietwyk wrote:
> > I have a QTabWidget with several tabs/pages - only some of 
> > which are relevant at any given time. I can't find a way to 
> > hide the tabs.
> 
> Something like the following may work:
> 
> QTabWidget* tabs;
> QWidget* tab1;
> QWidget* tab2;
> 
> /* Hide tab1 */
> tabs->removeTab(tabs->indexOf(tab1));
> 
> /* Re-add tab1 before tab2 */
> tabs->insertTab(tabs->indexOf(tab2), tab1, "tab1");

Hi Andy, 

Thanks for replying.  I haven't tried that, since knowing where to insert
would be more messy than clear and add. 

Tony.




More information about the Qt-interest-old mailing list