mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2025-04-01 02:42:39 +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()
|
void MainWindowPrivate::restoreState()
|
||||||
{
|
{
|
||||||
/*QSettings Settings("Settings.ini", QSettings::IniFormat);
|
QSettings Settings("Settings.ini", QSettings::IniFormat);
|
||||||
_this->restoreGeometry(Settings.value("mainWindow/Geometry").toByteArray());
|
_this->restoreGeometry(Settings.value("mainWindow/Geometry").toByteArray());
|
||||||
_this->restoreState(Settings.value("mainWindow/State").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
|
CDockContainerWidget* CDockWidget::dockContainer() const
|
||||||
{
|
{
|
||||||
return d->DockArea->dockContainer();
|
if (d->DockArea)
|
||||||
|
{
|
||||||
|
return d->DockArea->dockContainer();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -426,9 +433,9 @@ void CDockWidget::toggleView(bool Open)
|
|||||||
void CDockWidget::toggleViewInternal(bool Open)
|
void CDockWidget::toggleViewInternal(bool Open)
|
||||||
{
|
{
|
||||||
CDockContainerWidget* DockContainer = dockContainer();
|
CDockContainerWidget* DockContainer = dockContainer();
|
||||||
CDockWidget* TopLevelDockWidget = nullptr;;
|
CDockWidget* TopLevelDockWidget = nullptr;
|
||||||
|
|
||||||
if (Open)
|
if (Open && DockContainer)
|
||||||
{
|
{
|
||||||
TopLevelDockWidget = DockContainer->topLevelDockWidget();
|
TopLevelDockWidget = DockContainer->topLevelDockWidget();
|
||||||
}
|
}
|
||||||
@ -450,7 +457,7 @@ void CDockWidget::toggleViewInternal(bool Open)
|
|||||||
d->DockArea->toggleDockWidgetView(this, Open);
|
d->DockArea->toggleDockWidgetView(this, Open);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Open)
|
if (!Open && DockContainer)
|
||||||
{
|
{
|
||||||
TopLevelDockWidget = DockContainer->topLevelDockWidget();
|
TopLevelDockWidget = DockContainer->topLevelDockWidget();
|
||||||
}
|
}
|
||||||
@ -491,6 +498,7 @@ void CDockWidget::flagAsUnassigned()
|
|||||||
{
|
{
|
||||||
d->Closed = true;
|
d->Closed = true;
|
||||||
setParent(d->DockManager);
|
setParent(d->DockManager);
|
||||||
|
setVisible(false);
|
||||||
setDockArea(nullptr);
|
setDockArea(nullptr);
|
||||||
tabWidget()->setParent(this);
|
tabWidget()->setParent(this);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user