| 48 | } |
| 49 | |
| 50 | LayoutPart::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 | |
| 91 | LayoutPart::Pointer LayoutTreeNode::ComputeRelation( |
| 92 | QList<PartSashContainer::RelationshipInfo>& relations) |
nothing calls this directly
no test coverage detected