34 #include <QGridLayout> 38 #include "vtkRenderWindow.h" 50 mLayout =
new QGridLayout(
this);
51 this->setLayout(mLayout);
55 this->initBaseLayout();
64 void ViewCollectionWidgetMixed::initBaseLayout()
74 mTotalRegion =
merge(region, mTotalRegion);
79 this->mViewCache->clearCache();
81 overlay->
getView()->setType(type);
83 mOverlays.push_back(overlay);
85 this->addWidgetToLayout(mLayout, overlay, region);
89 mBaseRegion =
merge(region, mBaseRegion);
93 this->addWidgetToLayout(mLayout,
mBaseLayout, mBaseRegion);
111 void ViewCollectionWidgetMixed::addWidgetToLayout(QGridLayout* layout, QWidget* widget,
LayoutRegion region)
113 layout->addWidget(widget,
120 mViewCache->clearViews();
122 for (
unsigned i=0; i<mOverlays.size(); ++i)
124 mOverlays[i]->hide();
125 mLayout->removeWidget(mOverlays[i]);
134 this->initBaseLayout();
140 for (
unsigned i=0; i<mOverlays.size(); ++i)
148 for (
unsigned i=0; i<mOverlays.size(); ++i)
150 mOverlays[i]->render();
158 mLayout->setSpacing(val);
165 mLayout->setMargin(val);
170 return mLayout->spacing();
175 return mLayout->margin();
182 for (
unsigned i=0; i<mOverlays.size(); ++i)
183 retval.push_back(mOverlays[i]->getView());
189 for (
unsigned i=0; i<mOverlays.size(); ++i)
191 if (mOverlays[i]->getView()==view)
193 QPoint p = mOverlays[i]->mapToGlobal(QPoint(0,0));
194 p = this->mapFromGlobal(p);
201 p = this->mapFromGlobal(p);
208 Qt::ContextMenuPolicy policy = enable ? Qt::CustomContextMenu : Qt::PreventContextMenu;
209 for (
unsigned i=0; i<mOverlays.size(); ++i)
211 mOverlays[i]->setContextMenuPolicy(policy);
LayoutPosition span
size of region
boost::shared_ptr< class View > ViewPtr
void setStretchFactors(QGridLayout *layout, LayoutRegion region, int stretchFactor)
static MultiViewCachePtr create(RenderWindowFactoryPtr factory)
LayoutPosition pos
start position of region
boost::shared_ptr< class RenderWindowFactory > RenderWindowFactoryPtr
LayoutRegion merge(LayoutRegion a, LayoutRegion b)
Namespace for all CustusX production code.