MCPcopy Create free account
hub / github.com/MITK/MITK / Replace

Method Replace

Plugins/org.blueberry.ui.qt/src/internal/berryPartStack.cpp:878–903  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

876}
877
878void PartStack::Replace(LayoutPart::Pointer oldChild, LayoutPart::Pointer newChild)
879{
880 ChildVector::iterator loc = std::find(children.begin(), children.end(), oldChild);
881 int idx = 0;
882 int numPlaceholders = 0;
883 //subtract the number of placeholders still existing in the list
884 //before this one - they wont have parts.
885 for (ChildVector::iterator iter = children.begin(); iter != loc; ++iter, ++idx)
886 {
887 if ((*iter)->IsPlaceHolder())
888 {
889 numPlaceholders++;
890 }
891 }
892 ObjectInt::Pointer cookie(new ObjectInt(idx - numPlaceholders));
893 children.insert(loc, newChild);
894
895 this->ShowPart(newChild, cookie);
896
897 if (oldChild == requestedCurrent && newChild.Cast<PartPane>() != 0)
898 {
899 this->SetSelection(newChild.Cast<PartPane>());
900 }
901
902 this->Remove(oldChild);
903}
904
905int PartStack::ComputePreferredSize(bool width, int availableParallel,
906 int availablePerpendicular, int preferredParallel)

Callers 6

HideEditorAreaLocalMethod · 0.45
ShowEditorAreaLocalMethod · 0.45
AddPartMethod · 0.45
DerefPartMethod · 0.45
RemovePartMethod · 0.45

Calls 6

ShowPartMethod · 0.95
SetSelectionMethod · 0.95
RemoveMethod · 0.95
beginMethod · 0.45
endMethod · 0.45
IsPlaceHolderMethod · 0.45

Tested by 6

HideEditorAreaLocalMethod · 0.36
ShowEditorAreaLocalMethod · 0.36
AddPartMethod · 0.36
DerefPartMethod · 0.36
RemovePartMethod · 0.36