25 #include <qwidgetstack.h>
30 QHBoxLayout *layout =
new QHBoxLayout(
this);
32 m_wStack =
new QWidgetStack(
this);
33 layout->addWidget(m_bar,0);
34 layout->addWidget(m_wStack,5);
37 connect(m_bar,SIGNAL(allTabsOff()),m_wStack,SLOT(hide()));
38 connect(m_bar, SIGNAL(activatedTab(
int)),
this, SLOT(
setCurrentPage(
int)));
49 m_bar->
addTab(tabCap,m_autoIndexer);
50 m_wStack->addWidget(w,m_autoIndexer);
56 return m_wStack->widget(
id);
63 return m_wStack->visibleWidget();
73 int _id = m_wStack->id(w);
77 m_wStack->removeWidget(w);
82 QWidget *w = m_wStack->widget(
id);
90 return m_wStack->id(w);
95 if(m_wStack->isHidden())
96 return m_bar->sizeHint();
97 int width = m_bar->sizeHint().width();
98 int height = m_bar->sizeHint().height();
99 width += m_wStack->sizeHint().width();
100 height = QMAX(height,m_wStack->sizeHint().height());
101 return QSize(width,height);
106 if(!m_wStack->isShown())
108 m_wStack->setShown(
true);
111 m_wStack->raiseWidget(
id);
112 QWidget *w = m_wStack->widget(
id);
118 qWarning(
"BUG: Tab id and widget id mismatch");
124 m_bar->blockSignals(
true);
126 m_bar->blockSignals(
false);
131 int _id = m_wStack->id(w);
142 QHBoxLayout *l = (QHBoxLayout*)layout();
145 qWarning(
"Error layout is null");
154 l->addWidget(m_bar,0);
155 l->addWidget(m_wStack,5);
159 l->addWidget(m_wStack,5);
160 l->addWidget(m_bar,0);