mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-12-25 23:51:33 +08:00
Improved setting of CDockWidgetTab focus
This commit is contained in:
parent
835a20f03f
commit
f54869fbf7
@ -886,7 +886,22 @@ void CDockManager::onFocusObjectChanged(QObject *focusObject)
|
||||
{
|
||||
return;
|
||||
}
|
||||
auto DockWidget = internal::findParent<CDockWidget*>(FocusWidget);
|
||||
|
||||
CDockWidget* DockWidget = nullptr;
|
||||
|
||||
std::cout << "CDockManager::onFocusObjectChanged " << focusObject->objectName().toStdString()
|
||||
<< " meta: " << focusObject->metaObject()->className() << std::endl;
|
||||
|
||||
auto DockWidgetTab = qobject_cast<CDockWidgetTab*>(focusObject);
|
||||
if (DockWidgetTab)
|
||||
{
|
||||
DockWidget = DockWidgetTab->dockWidget();
|
||||
}
|
||||
else
|
||||
{
|
||||
DockWidget = internal::findParent<CDockWidget*>(FocusWidget);
|
||||
}
|
||||
|
||||
if (!DockWidget)
|
||||
{
|
||||
return;
|
||||
|
@ -285,6 +285,7 @@ CDockWidgetTab::CDockWidgetTab(CDockWidget* DockWidget, QWidget *parent) :
|
||||
setAttribute(Qt::WA_NoMousePropagation, true);
|
||||
d->DockWidget = DockWidget;
|
||||
d->createLayout();
|
||||
setFocusPolicy(Qt::ClickFocus);
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
|
Loading…
Reference in New Issue
Block a user