mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-12-25 07:31:33 +08:00
Added focusedDockWidget() function to DockManager
This commit is contained in:
parent
044a43d793
commit
fdedd7d92a
@ -381,6 +381,13 @@ void CDockFocusController::onStateRestored()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//==========================================================================
|
||||
CDockWidget* CDockFocusController::focusedDockWidget() const
|
||||
{
|
||||
return d->FocusedDockWidget.data();
|
||||
}
|
||||
|
||||
} // namespace ads
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
@ -77,6 +77,12 @@ public:
|
||||
*/
|
||||
void notifyFloatingWidgetDrop(CFloatingDockContainer* FloatingWidget);
|
||||
|
||||
/**
|
||||
* Returns the dock widget that has focus style in the ui or a nullptr if
|
||||
* not dock widget is painted focused.
|
||||
*/
|
||||
CDockWidget* focusedDockWidget() const;
|
||||
|
||||
public slots:
|
||||
/**
|
||||
* Request a focus change to the given dock widget
|
||||
|
@ -1042,6 +1042,20 @@ void CDockManager::setDockWidgetFocused(CDockWidget* DockWidget)
|
||||
}
|
||||
|
||||
|
||||
//===========================================================================
|
||||
CDockWidget* CDockManager::focusedDockWidget() const
|
||||
{
|
||||
if (!d->FocusController)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
return d->FocusController->focusedDockWidget();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} // namespace ads
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
@ -476,6 +476,14 @@ public:
|
||||
bool eventFilter(QObject *obj, QEvent *e) override;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Returns the dock widget that has focus style in the ui or a nullptr if
|
||||
* not dock widget is painted focused.
|
||||
* If the flag FocusHighlighting is disabled, this function always returns
|
||||
* nullptr.
|
||||
*/
|
||||
CDockWidget* focusedDockWidget() const;
|
||||
|
||||
public slots:
|
||||
/**
|
||||
* Opens the perspective with the given name.
|
||||
|
Loading…
Reference in New Issue
Block a user