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

andrew.m.goth at l-3com.com andrew.m.goth at l-3com.com
Fri Jan 30 00:39:56 CET 2009


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");

-- 
Andy Goth
<amgoth at link.com>




More information about the Qt-interest-old mailing list