13 #include <QGridLayout> 17 #include "vtkRenderWindow.h" 29 mLayout =
new QGridLayout(
this);
30 this->setLayout(mLayout);
34 this->initBaseLayout();
43 void ViewCollectionWidgetMixed::initBaseLayout()
53 mTotalRegion =
merge(region, mTotalRegion);
58 this->mViewCache->clearCache();
60 overlay->
getView()->setType(type);
62 mOverlays.push_back(overlay);
64 this->addWidgetToLayout(mLayout, overlay, region);
68 mBaseRegion =
merge(region, mBaseRegion);
72 this->addWidgetToLayout(mLayout,
mBaseLayout, mBaseRegion);
90 void ViewCollectionWidgetMixed::addWidgetToLayout(QGridLayout* layout, QWidget* widget,
LayoutRegion region)
92 layout->addWidget(widget,
99 mViewCache->clearViews();
101 for (
unsigned i=0; i<mOverlays.size(); ++i)
103 mOverlays[i]->hide();
104 mLayout->removeWidget(mOverlays[i]);
113 this->initBaseLayout();
119 for (
unsigned i=0; i<mOverlays.size(); ++i)
127 for (
unsigned i=0; i<mOverlays.size(); ++i)
129 mOverlays[i]->render();
137 mLayout->setSpacing(val);
144 mLayout->setMargin(val);
149 return mLayout->spacing();
154 return mLayout->margin();
161 for (
unsigned i=0; i<mOverlays.size(); ++i)
162 retval.push_back(mOverlays[i]->getView());
168 for (
unsigned i=0; i<mOverlays.size(); ++i)
170 if (mOverlays[i]->getView()==view)
172 QPoint p = mOverlays[i]->mapToGlobal(QPoint(0,0));
173 p = this->mapFromGlobal(p);
180 p = this->mapFromGlobal(p);
187 Qt::ContextMenuPolicy policy = enable ? Qt::CustomContextMenu : Qt::PreventContextMenu;
188 for (
unsigned i=0; i<mOverlays.size(); ++i)
190 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.