7 #include "fwGuiQt/layoutManager/ToolboxLayoutManager.hpp" 9 #include "fwGuiQt/container/QtContainer.hpp" 11 #include <fwCore/base.hpp> 13 #include <fwGui/registry/macros.hpp> 15 #include <QScrollArea> 17 #include <QVBoxLayout> 32 ToolboxLayoutManager::~ToolboxLayoutManager()
42 ::fwGuiQt::container::QtContainer::sptr parentContainer =
43 ::fwGuiQt::container::QtContainer::dynamicCast(parent);
45 QVBoxLayout* layout =
new QVBoxLayout();
46 parentContainer->setLayout(layout);
48 layout->setContentsMargins(0, 0, 0, 0);
50 QScrollArea* sv =
new QScrollArea();
52 sv->setWidget(toolbox);
53 sv->setWidgetResizable(
true);
54 layout->addWidget(sv);
56 const std::list< ViewInfo>& views = this->getViewsInfo();
59 int border = viewInfo.m_border;
60 QWidget* panel =
new QWidget();
61 panel->setMinimumSize(std::max(viewInfo.m_minSize.first, 0), std::max(viewInfo.m_minSize.second, 0));
62 panel->setContentsMargins(border, border, border, border);
64 ::fwGuiQt::container::QtContainer::sptr subContainer = ::fwGuiQt::container::QtContainer::New();
65 subContainer->setQtContainer(panel);
69 if(viewInfo.m_useScrollBar)
71 QScrollArea* scrollArea =
new QScrollArea(toolbox);
72 scrollArea->setWidget(panel);
73 scrollArea->setWidgetResizable(
true );
74 index = toolbox->addItem(scrollArea, QString::fromStdString(viewInfo.m_caption));
78 index = toolbox->addItem(panel, QString::fromStdString(viewInfo.m_caption));
81 if(viewInfo.m_expanded)
83 toolbox->expandItem(index);
86 if(
false == viewInfo.m_visible)
88 subContainer->setVisible(
false);
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.
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.