mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-11-15 13:15:43 +08:00
Fixed the return value of dockContainer() function if no dock area is assigned, fixed flagAsUnassigned() function
This commit is contained in:
parent
9fec2bd515
commit
548dfb363a
@ -235,10 +235,10 @@ void MainWindowPrivate::saveState()
|
||||
//============================================================================
|
||||
void MainWindowPrivate::restoreState()
|
||||
{
|
||||
/*QSettings Settings("Settings.ini", QSettings::IniFormat);
|
||||
QSettings Settings("Settings.ini", QSettings::IniFormat);
|
||||
_this->restoreGeometry(Settings.value("mainWindow/Geometry").toByteArray());
|
||||
_this->restoreState(Settings.value("mainWindow/State").toByteArray());
|
||||
DockManager->restoreState(Settings.value("mainWindow/DockingState").toByteArray());*/
|
||||
DockManager->restoreState(Settings.value("mainWindow/DockingState").toByteArray());
|
||||
}
|
||||
|
||||
|
||||
|
@ -327,7 +327,14 @@ void CDockWidget::setDockManager(CDockManager* DockManager)
|
||||
//============================================================================
|
||||
CDockContainerWidget* CDockWidget::dockContainer() const
|
||||
{
|
||||
if (d->DockArea)
|
||||
{
|
||||
return d->DockArea->dockContainer();
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -426,9 +433,9 @@ void CDockWidget::toggleView(bool Open)
|
||||
void CDockWidget::toggleViewInternal(bool Open)
|
||||
{
|
||||
CDockContainerWidget* DockContainer = dockContainer();
|
||||
CDockWidget* TopLevelDockWidget = nullptr;;
|
||||
CDockWidget* TopLevelDockWidget = nullptr;
|
||||
|
||||
if (Open)
|
||||
if (Open && DockContainer)
|
||||
{
|
||||
TopLevelDockWidget = DockContainer->topLevelDockWidget();
|
||||
}
|
||||
@ -450,7 +457,7 @@ void CDockWidget::toggleViewInternal(bool Open)
|
||||
d->DockArea->toggleDockWidgetView(this, Open);
|
||||
}
|
||||
|
||||
if (!Open)
|
||||
if (!Open && DockContainer)
|
||||
{
|
||||
TopLevelDockWidget = DockContainer->topLevelDockWidget();
|
||||
}
|
||||
@ -491,6 +498,7 @@ void CDockWidget::flagAsUnassigned()
|
||||
{
|
||||
d->Closed = true;
|
||||
setParent(d->DockManager);
|
||||
setVisible(false);
|
||||
setDockArea(nullptr);
|
||||
tabWidget()->setParent(this);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user