mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-12-24 23:31:32 +08:00
Fixed null pointer bug in DockFocusController.cpp
This commit is contained in:
parent
87b0596ebc
commit
89aa3d5251
@ -116,7 +116,13 @@ void DockFocusControllerPrivate::updateDockWidgetFocus(CDockWidget* DockWidget)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto Window = DockWidget->dockContainer()->window()->windowHandle();
|
QWindow* Window = nullptr;
|
||||||
|
auto DockContainer = DockWidget->dockContainer();
|
||||||
|
if (DockContainer)
|
||||||
|
{
|
||||||
|
Window = DockContainer->window()->windowHandle();
|
||||||
|
}
|
||||||
|
|
||||||
if (Window)
|
if (Window)
|
||||||
{
|
{
|
||||||
Window->setProperty("FocusedDockWidget", QVariant::fromValue<CDockWidget*>(DockWidget));
|
Window->setProperty("FocusedDockWidget", QVariant::fromValue<CDockWidget*>(DockWidget));
|
||||||
@ -145,7 +151,14 @@ void DockFocusControllerPrivate::updateDockWidgetFocus(CDockWidget* DockWidget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
auto NewFloatingWidget = FocusedDockWidget->dockContainer()->floatingWidget();
|
|
||||||
|
CFloatingDockContainer* NewFloatingWidget = nullptr;
|
||||||
|
DockContainer = FocusedDockWidget->dockContainer();
|
||||||
|
if (DockContainer)
|
||||||
|
{
|
||||||
|
NewFloatingWidget = DockContainer->floatingWidget();
|
||||||
|
}
|
||||||
|
|
||||||
if (NewFloatingWidget)
|
if (NewFloatingWidget)
|
||||||
{
|
{
|
||||||
NewFloatingWidget->setProperty("FocusedDockWidget", QVariant::fromValue(DockWidget));
|
NewFloatingWidget->setProperty("FocusedDockWidget", QVariant::fromValue(DockWidget));
|
||||||
|
Loading…
Reference in New Issue
Block a user