1
0
mirror of https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git synced 2025-04-01 02:42:39 +08:00

Some smal improvements in FloatingDockContainer

This commit is contained in:
Uwe Kindler 2018-10-31 22:13:34 +01:00
parent 1dfabb3bef
commit 268f8655a1
2 changed files with 17 additions and 11 deletions

View File

@ -177,13 +177,13 @@ void MainWindowPrivate::createContent()
DockWidget->setFeature(ads::CDockWidget::DockWidgetClosable, false); DockWidget->setFeature(ads::CDockWidget::DockWidgetClosable, false);
DockManager->addDockWidget(ads::LeftDockWidgetArea, DockWidget); DockManager->addDockWidget(ads::LeftDockWidgetArea, DockWidget);
DockManager->addDockWidget(ads::LeftDockWidgetArea, createLongTextLabelDockWidget(ViewMenu)); DockManager->addDockWidget(ads::LeftDockWidgetArea, createLongTextLabelDockWidget(ViewMenu));
/*auto FileSystemWidget = createFileSystemTreeDockWidget(ViewMenu); auto FileSystemWidget = createFileSystemTreeDockWidget(ViewMenu);
auto ToolBar = FileSystemWidget->toolBar(); auto ToolBar = FileSystemWidget->toolBar();
ToolBar->addAction(ui.actionSaveState); ToolBar->addAction(ui.actionSaveState);
ToolBar->addAction(ui.actionRestoreState); ToolBar->addAction(ui.actionRestoreState);
DockManager->addDockWidget(ads::BottomDockWidgetArea, FileSystemWidget);*/ DockManager->addDockWidget(ads::BottomDockWidgetArea, FileSystemWidget);
/*FileSystemWidget = createFileSystemTreeDockWidget(ViewMenu); FileSystemWidget = createFileSystemTreeDockWidget(ViewMenu);
ToolBar = FileSystemWidget->toolBar(); ToolBar = FileSystemWidget->toolBar();
ToolBar->addAction(ui.actionSaveState); ToolBar->addAction(ui.actionSaveState);
ToolBar->addAction(ui.actionRestoreState); ToolBar->addAction(ui.actionRestoreState);
@ -198,7 +198,7 @@ void MainWindowPrivate::createContent()
DockManager->addDockWidget(ads::TopDockWidgetArea, createLongTextLabelDockWidget(ViewMenu), RighDockArea); DockManager->addDockWidget(ads::TopDockWidgetArea, createLongTextLabelDockWidget(ViewMenu), RighDockArea);
auto BottomDockArea = DockManager->addDockWidget(ads::BottomDockWidgetArea, createLongTextLabelDockWidget(ViewMenu), RighDockArea); auto BottomDockArea = DockManager->addDockWidget(ads::BottomDockWidgetArea, createLongTextLabelDockWidget(ViewMenu), RighDockArea);
DockManager->addDockWidget(ads::RightDockWidgetArea, createLongTextLabelDockWidget(ViewMenu), RighDockArea); DockManager->addDockWidget(ads::RightDockWidgetArea, createLongTextLabelDockWidget(ViewMenu), RighDockArea);
DockManager->addDockWidget(ads::CenterDockWidgetArea, createLongTextLabelDockWidget(ViewMenu), BottomDockArea);*/ DockManager->addDockWidget(ads::CenterDockWidgetArea, createLongTextLabelDockWidget(ViewMenu), BottomDockArea);
} }

View File

@ -43,6 +43,7 @@
#include "DockWidget.h" #include "DockWidget.h"
#include "DockOverlay.h" #include "DockOverlay.h"
#include <iostream>
namespace ads namespace ads
{ {
@ -332,13 +333,11 @@ void CFloatingDockContainer::closeEvent(QCloseEvent *event)
//============================================================================ //============================================================================
void CFloatingDockContainer::hideEvent(QHideEvent *event) void CFloatingDockContainer::hideEvent(QHideEvent *event)
{ {
qDebug() << "CFloatingDockContainer hideEvent"; std::cout << "CFloatingDockContainer hideEvent" << std::endl;
QWidget::hideEvent(event); QWidget::hideEvent(event);
auto OpenDockAreas = d->DockContainer->openedDockAreas(); for (auto DockArea : d->DockContainer->openedDockAreas())
for (auto DockArea : OpenDockAreas)
{ {
auto OpenDockWidgets = DockArea->openedDockWidgets(); for (auto DockWidget : DockArea->openedDockWidgets())
for (auto DockWidget : OpenDockWidgets)
{ {
DockWidget->toggleView(false); DockWidget->toggleView(false);
} }
@ -349,15 +348,22 @@ void CFloatingDockContainer::hideEvent(QHideEvent *event)
//============================================================================ //============================================================================
void CFloatingDockContainer::showEvent(QShowEvent *event) void CFloatingDockContainer::showEvent(QShowEvent *event)
{ {
std::cout << "CFloatingDockContainer showEvent" << std::endl;
QWidget::showEvent(event); 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); auto DockArea = DockContainer->dockArea(i);
for (auto DockWidget : DockArea->openedDockWidgets()) for (auto DockWidget : DockArea->openedDockWidgets())
{ {
DockWidget->setToggleViewActionChecked(true); DockWidget->setToggleViewActionChecked(true);
} }
}*/
for (auto DockArea : d->DockContainer->openedDockAreas())
{
for (auto DockWidget : DockArea->openedDockWidgets())
{
DockWidget->setToggleViewActionChecked(true);
}
} }
} }