* @brief Deletes container and move the other split (the one that is not this) to the parent of container. * If the parent container is a splitter then we will insert it instead of the container. * Otherwise if the parent is a floating window we will insert it as embedded widget of the window. **/
| 574 | * Otherwise if the parent is a floating window we will insert it as embedded widget of the window. |
| 575 | **/ |
| 576 | void |
| 577 | TabWidget::closeSplitterAndMoveOtherSplitToParent(Splitter* container) |
| 578 | { |
| 579 | QWidget* otherSplit = 0; |
| 580 | |
| 581 | /*identifying the other split*/ |
| 582 | getOtherSplitWidget(container, this, otherSplit); |
| 583 | |
| 584 | Splitter* parentSplitter = dynamic_cast<Splitter*>( container->parentWidget() ); |
| 585 | QWidget* parent = container->parentWidget(); |
| 586 | FloatingWidget* parentWindow = 0; |
| 587 | while (parent) { |
| 588 | parentWindow = dynamic_cast<FloatingWidget*>(parent); |
| 589 | if (parentWindow) { |
| 590 | break; |
| 591 | } |
| 592 | parent = parent->parentWidget(); |
| 593 | } |
| 594 | |
| 595 | assert(parentSplitter || parentWindow); |
| 596 | |
| 597 | if (parentSplitter) { |
| 598 | QList<int> mainContainerSizes = parentSplitter->sizes(); |
| 599 | |
| 600 | /*Removing the splitter container from its parent*/ |
| 601 | int containerIndexInParentSplitter = parentSplitter->indexOf(container); |
| 602 | parentSplitter->removeChild_mt_safe(container); |
| 603 | |
| 604 | /*moving the other split to the mainContainer*/ |
| 605 | if (otherSplit) { |
| 606 | parentSplitter->insertChild_mt_safe(containerIndexInParentSplitter, otherSplit); |
| 607 | otherSplit->setVisible(true); |
| 608 | } |
| 609 | |
| 610 | /*restore the main container sizes*/ |
| 611 | parentSplitter->setSizes_mt_safe(mainContainerSizes); |
| 612 | } else { |
| 613 | if (otherSplit) { |
| 614 | assert(parentWindow); |
| 615 | parentWindow->removeEmbeddedWidget(); |
| 616 | parentWindow->setWidget(otherSplit); |
| 617 | } |
| 618 | } |
| 619 | |
| 620 | /*Remove the container from everywhere*/ |
| 621 | _imp->gui->unregisterSplitter(container); |
| 622 | // container->setParent(NULL); |
| 623 | container->deleteLater(); |
| 624 | } |
| 625 | |
| 626 | void |
| 627 | TabWidget::closePane() |
nothing calls this directly
no test coverage detected