| 537 | } |
| 538 | |
| 539 | void LayoutTreeNode::DoSetBounds(const QRect& b) |
| 540 | { |
| 541 | if (!children[0]->IsVisible()) |
| 542 | { |
| 543 | children[1]->SetBounds(b); |
| 544 | this->GetSash()->SetVisible(false); |
| 545 | return; |
| 546 | } |
| 547 | if (!children[1]->IsVisible()) |
| 548 | { |
| 549 | children[0]->SetBounds(b); |
| 550 | this->GetSash()->SetVisible(false); |
| 551 | return; |
| 552 | } |
| 553 | |
| 554 | QRect bounds = b; |
| 555 | |
| 556 | bool vertical = this->GetSash()->IsVertical(); |
| 557 | |
| 558 | // If this is a horizontal sash, flip coordinate systems so |
| 559 | // that we can eliminate special cases |
| 560 | if (!vertical) |
| 561 | { |
| 562 | bounds = FlipRect(bounds); |
| 563 | } |
| 564 | |
| 565 | ChildSizes childSizes = this->ComputeChildSizes(bounds.width(), bounds.height(), |
| 566 | this->GetSash()->GetLeft(), this->GetSash()->GetRight(), bounds.width()); |
| 567 | |
| 568 | this->GetSash()->SetVisible(true); |
| 569 | this->GetSash()->SetEnabled(childSizes.resizable); |
| 570 | |
| 571 | QRect leftBounds = QRect(bounds.x(), bounds.y(), childSizes.left, bounds.height()); |
| 572 | QRect sashBounds = QRect(leftBounds.x() + leftBounds.width(), bounds.y(), this->GetSashSize(), bounds.height()); |
| 573 | QRect rightBounds = QRect(sashBounds.x() + sashBounds.width(), bounds.y(), |
| 574 | childSizes.right, bounds.height()); |
| 575 | |
| 576 | if (!vertical) |
| 577 | { |
| 578 | leftBounds = FlipRect(leftBounds); |
| 579 | sashBounds = FlipRect(sashBounds); |
| 580 | rightBounds = FlipRect(rightBounds); |
| 581 | } |
| 582 | |
| 583 | this->GetSash()->SetBounds(sashBounds); |
| 584 | children[0]->SetBounds(leftBounds); |
| 585 | children[1]->SetBounds(rightBounds); |
| 586 | } |
| 587 | |
| 588 | void LayoutTreeNode::CreateControl(QWidget* parent) |
| 589 | { |
nothing calls this directly
no test coverage detected