7 #include "fwGuiQt/layoutManager/TabLayoutManager.hpp" 9 #include <fwCore/base.hpp> 11 #include <fwGui/registry/macros.hpp> 14 #include <QScrollArea> 30 TabLayoutManager::~TabLayoutManager()
39 m_parentContainer = ::fwGuiQt::container::QtContainer::dynamicCast(parent);
40 SLM_ASSERT(
"dynamicCast fwContainer to QtContainer failed", m_parentContainer);
42 QBoxLayout* layout =
new QBoxLayout(QBoxLayout::TopToBottom);
43 m_parentContainer->setLayout(layout);
45 m_tabWidget =
new QTabWidget();
46 layout->addWidget( m_tabWidget );
48 const std::list< ViewInfo>& views = this->getViewsInfo();
52 QWidget* widget =
new QWidget(m_tabWidget);
54 ::fwGuiQt::container::QtContainer::sptr subContainer = ::fwGuiQt::container::QtContainer::New();
55 subContainer->setQtContainer(widget);
59 if(viewInfo.m_useScrollBar)
61 QScrollArea* scrollArea =
new QScrollArea(m_tabWidget);
62 scrollArea->setWidget(widget);
63 scrollArea->setWidgetResizable(
true );
64 idx = m_tabWidget->addTab( scrollArea, QString::fromStdString(viewInfo.m_caption));
68 idx = m_tabWidget->addTab( widget, QString::fromStdString(viewInfo.m_caption));
71 if (viewInfo.m_isSelect )
73 m_tabWidget->setCurrentIndex(idx);
84 m_parentContainer->clean();
The namespace fwGui contains the base interface for IHM services.
#define SLM_TRACE_FUNC()
Trace contextual function signature.
Key class used to restrict access to Object construction. See http://www.drdobbs.com/184402053.
virtual FWGUIQT_API void createLayout(::fwGui::container::fwContainer::sptr parent) override
Instantiate layout with parent container.
virtual FWGUIQT_API void destroyLayout() override
Destroy local layout with sub containers.
#define SLM_ASSERT(message, cond)
work like 'assert' from 'cassert', with in addition a message logged by spylog (with FATAL loglevel) ...
std::vector< ::fwGui::container::fwContainer::sptr > m_subViews
All sub containers managed by this layout.
virtual FWGUI_API void destroySubViews()
Helper to destroy local sub views.
Defines the tab layout manager.