============================================================================
| 732 | |
| 733 | //============================================================================ |
| 734 | void CDockWidget::toggleView(bool Open) |
| 735 | { |
| 736 | // If the toggle view action mode is ActionModeShow, then Open is always |
| 737 | // true if the sender is the toggle view action |
| 738 | QAction* Sender = qobject_cast<QAction*>(sender()); |
| 739 | if (Sender == d->ToggleViewAction && !d->ToggleViewAction->isCheckable()) |
| 740 | { |
| 741 | Open = true; |
| 742 | } |
| 743 | |
| 744 | // If the dock widget state is different, then we really need to toggle |
| 745 | // the state. If we are in the right state, then we simply make this |
| 746 | // dock widget the current dock widget |
| 747 | auto AutoHideContainer = autoHideDockContainer(); |
| 748 | if (d->Closed != !Open) |
| 749 | { |
| 750 | toggleViewInternal(Open); |
| 751 | } |
| 752 | else if (Open && d->DockArea && !AutoHideContainer) |
| 753 | { |
| 754 | raise(); |
| 755 | } |
| 756 | |
| 757 | if (Open && AutoHideContainer) |
| 758 | { |
| 759 | AutoHideContainer->collapseView(false); |
| 760 | } |
| 761 | } |
| 762 | |
| 763 | |
| 764 | //============================================================================ |
no test coverage detected