diff --git a/demo/MainWindow.cpp b/demo/MainWindow.cpp index a21bd91..cb47b52 100644 --- a/demo/MainWindow.cpp +++ b/demo/MainWindow.cpp @@ -177,13 +177,13 @@ void MainWindowPrivate::createContent() DockWidget->setFeature(ads::CDockWidget::DockWidgetClosable, false); DockManager->addDockWidget(ads::LeftDockWidgetArea, DockWidget); DockManager->addDockWidget(ads::LeftDockWidgetArea, createLongTextLabelDockWidget(ViewMenu)); - /*auto FileSystemWidget = createFileSystemTreeDockWidget(ViewMenu); + auto FileSystemWidget = createFileSystemTreeDockWidget(ViewMenu); auto ToolBar = FileSystemWidget->toolBar(); ToolBar->addAction(ui.actionSaveState); ToolBar->addAction(ui.actionRestoreState); - DockManager->addDockWidget(ads::BottomDockWidgetArea, FileSystemWidget);*/ + DockManager->addDockWidget(ads::BottomDockWidgetArea, FileSystemWidget); - /*FileSystemWidget = createFileSystemTreeDockWidget(ViewMenu); + FileSystemWidget = createFileSystemTreeDockWidget(ViewMenu); ToolBar = FileSystemWidget->toolBar(); ToolBar->addAction(ui.actionSaveState); ToolBar->addAction(ui.actionRestoreState); @@ -198,7 +198,7 @@ void MainWindowPrivate::createContent() DockManager->addDockWidget(ads::TopDockWidgetArea, createLongTextLabelDockWidget(ViewMenu), RighDockArea); auto BottomDockArea = DockManager->addDockWidget(ads::BottomDockWidgetArea, createLongTextLabelDockWidget(ViewMenu), RighDockArea); DockManager->addDockWidget(ads::RightDockWidgetArea, createLongTextLabelDockWidget(ViewMenu), RighDockArea); - DockManager->addDockWidget(ads::CenterDockWidgetArea, createLongTextLabelDockWidget(ViewMenu), BottomDockArea);*/ + DockManager->addDockWidget(ads::CenterDockWidgetArea, createLongTextLabelDockWidget(ViewMenu), BottomDockArea); } diff --git a/src/FloatingDockContainer.cpp b/src/FloatingDockContainer.cpp index db82c7f..7a119a8 100644 --- a/src/FloatingDockContainer.cpp +++ b/src/FloatingDockContainer.cpp @@ -43,6 +43,7 @@ #include "DockWidget.h" #include "DockOverlay.h" +#include namespace ads { @@ -332,13 +333,11 @@ void CFloatingDockContainer::closeEvent(QCloseEvent *event) //============================================================================ void CFloatingDockContainer::hideEvent(QHideEvent *event) { - qDebug() << "CFloatingDockContainer hideEvent"; + std::cout << "CFloatingDockContainer hideEvent" << std::endl; QWidget::hideEvent(event); - auto OpenDockAreas = d->DockContainer->openedDockAreas(); - for (auto DockArea : OpenDockAreas) + for (auto DockArea : d->DockContainer->openedDockAreas()) { - auto OpenDockWidgets = DockArea->openedDockWidgets(); - for (auto DockWidget : OpenDockWidgets) + for (auto DockWidget : DockArea->openedDockWidgets()) { DockWidget->toggleView(false); } @@ -349,15 +348,22 @@ void CFloatingDockContainer::hideEvent(QHideEvent *event) //============================================================================ void CFloatingDockContainer::showEvent(QShowEvent *event) { + std::cout << "CFloatingDockContainer showEvent" << std::endl; QWidget::showEvent(event); - CDockContainerWidget* DockContainer = dockContainer(); - for (int i = 0; i < DockContainer->dockAreaCount(); ++i) + /*for (int i = 0; i < DockContainer->dockAreaCount(); ++i) { auto DockArea = DockContainer->dockArea(i); for (auto DockWidget : DockArea->openedDockWidgets()) { DockWidget->setToggleViewActionChecked(true); } + }*/ + for (auto DockArea : d->DockContainer->openedDockAreas()) + { + for (auto DockWidget : DockArea->openedDockWidgets()) + { + DockWidget->setToggleViewActionChecked(true); + } } }