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

Method DoSetBounds

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

Source from the content-addressed store, hash-verified

537}
538
539void 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
588void LayoutTreeNode::CreateControl(QWidget* parent)
589{

Callers

nothing calls this directly

Calls 11

GetSashMethod · 0.95
ComputeChildSizesMethod · 0.95
GetSashSizeMethod · 0.95
QRectClass · 0.85
IsVerticalMethod · 0.80
GetLeftMethod · 0.80
GetRightMethod · 0.80
IsVisibleMethod · 0.45
SetBoundsMethod · 0.45
SetVisibleMethod · 0.45
SetEnabledMethod · 0.45

Tested by

no test coverage detected