mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-11-15 13:15:43 +08:00
Added some debug output
This commit is contained in:
parent
c3a5e3ef21
commit
fc04aa2411
@ -182,7 +182,7 @@ void MainWindowPrivate::createContent()
|
||||
ToolBar->addAction(ui.actionRestoreState);
|
||||
DockManager->addDockWidget(ads::BottomDockWidgetArea, FileSystemWidget);
|
||||
|
||||
FileSystemWidget = createFileSystemTreeDockWidget(ViewMenu);
|
||||
/*FileSystemWidget = createFileSystemTreeDockWidget(ViewMenu);
|
||||
ToolBar = FileSystemWidget->toolBar();
|
||||
ToolBar->addAction(ui.actionSaveState);
|
||||
ToolBar->addAction(ui.actionRestoreState);
|
||||
@ -197,7 +197,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);*/
|
||||
}
|
||||
|
||||
|
||||
|
@ -199,11 +199,12 @@ public:
|
||||
|
||||
void setCurrentIndex(int index)
|
||||
{
|
||||
std::cout << "setCurrentIndex" << std::endl;
|
||||
std::cout << "CDockAreaLayout::setCurrentIndex " << index << std::endl;
|
||||
QWidget *prev = currentWidget();
|
||||
QWidget *next = widget(index);
|
||||
if (!next || (next == prev && !m_CurrentWidget))
|
||||
{
|
||||
std::cout << "return" << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -629,6 +630,12 @@ void CDockAreaWidget::setCurrentDockWidget(CDockWidget* DockWidget)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (dockManager()->isRestoringState())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
setCurrentIndex(Index);
|
||||
}
|
||||
|
||||
@ -636,6 +643,7 @@ void CDockAreaWidget::setCurrentDockWidget(CDockWidget* DockWidget)
|
||||
//============================================================================
|
||||
void CDockAreaWidget::setCurrentIndex(int index)
|
||||
{
|
||||
std::cout << "CDockAreaWidget::setCurrentIndex " << index << std::endl;
|
||||
if (index < 0 || index > (d->TabBar->count() - 1))
|
||||
{
|
||||
qWarning() << Q_FUNC_INFO << "Invalid index" << index;
|
||||
@ -648,11 +656,8 @@ void CDockAreaWidget::setCurrentIndex(int index)
|
||||
auto Features = CurrentTab->dockWidget()->features();
|
||||
d->CloseButton->setVisible(Features.testFlag(CDockWidget::DockWidgetClosable));
|
||||
|
||||
if (!dockManager()->isRestoringState())
|
||||
{
|
||||
d->ContentsLayout->setCurrentIndex(index);
|
||||
d->ContentsLayout->currentWidget()->show();
|
||||
}
|
||||
d->ContentsLayout->setCurrentIndex(index);
|
||||
d->ContentsLayout->currentWidget()->show();
|
||||
emit currentChanged(index);
|
||||
}
|
||||
|
||||
|
@ -254,8 +254,13 @@ bool DockManagerPrivate::restoreState(const QByteArray &state, int version)
|
||||
// Now all dock areas are properly restored and we setup the index of
|
||||
// The dock areas because the previous toggleView() action has changed
|
||||
// the dock area index
|
||||
std::cout << "Restoring dock container indexes" << std::endl;
|
||||
int Count = 0;
|
||||
for (auto DockContainer : Containers)
|
||||
{
|
||||
Count++;
|
||||
std::cout << "Restoring container " << Count << " floating: "
|
||||
<< DockContainer->isFloating() << " DockAreaCount " << DockContainer->dockAreaCount() << std::endl;
|
||||
for (int i = 0; i < DockContainer->dockAreaCount(); ++i)
|
||||
{
|
||||
CDockAreaWidget* DockArea = DockContainer->dockArea(i);
|
||||
|
Loading…
Reference in New Issue
Block a user