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

Method FindPart

Plugins/org.blueberry.ui.qt/src/internal/berryLayoutTreeNode.cpp:50–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48}
49
50LayoutPart::Pointer LayoutTreeNode::FindPart(const QPoint& toFind)
51{
52 if (!children[0]->IsVisible())
53 {
54 if (!children[1]->IsVisible())
55 {
56 return LayoutPart::Pointer(nullptr);
57 }
58
59 return children[1]->FindPart(toFind);
60 }
61 else
62 {
63 if (!children[1]->IsVisible())
64 {
65 return children[0]->FindPart(toFind);
66 }
67 }
68
69 LayoutPartSash::Pointer sash = this->GetSash();
70
71 QRect bounds = sash->GetBounds();
72
73 if (sash->IsVertical())
74 {
75 if (toFind.x() < bounds.x() + (bounds.width() / 2))
76 {
77 return children[0]->FindPart(toFind);
78 }
79 return children[1]->FindPart(toFind);
80 }
81 else
82 {
83 if (toFind.y() < bounds.y() + (bounds.height() / 2))
84 {
85 return children[0]->FindPart(toFind);
86 }
87 return children[1]->FindPart(toFind);
88 }
89}
90
91LayoutPart::Pointer LayoutTreeNode::ComputeRelation(
92 QList<PartSashContainer::RelationshipInfo>& relations)

Callers

nothing calls this directly

Calls 4

GetSashMethod · 0.95
IsVerticalMethod · 0.80
IsVisibleMethod · 0.45
GetBoundsMethod · 0.45

Tested by

no test coverage detected