fix QDockWidget

This commit is contained in:
Le Tan 2022-01-08 16:01:05 +08:00
parent a5671e20e5
commit 09dba18994
2 changed files with 8 additions and 1 deletions

View File

@ -6,7 +6,7 @@
"version" : "3.11.0" "version" : "3.11.0"
}, },
"core" : { "core" : {
"theme" : "pure", "theme" : "moonlight",
"locale" : "", "locale" : "",
"shortcuts" : { "shortcuts" : {
"FullScreen" : "F11", "FullScreen" : "F11",

View File

@ -243,6 +243,8 @@ void DockWidgetHelper::activateDock(DockIndex p_dockIndex)
void DockWidgetHelper::activateDock(QDockWidget *p_dock) void DockWidgetHelper::activateDock(QDockWidget *p_dock)
{ {
bool needUpdateTabBar = !p_dock->isVisible();
p_dock->show(); p_dock->show();
Q_FOREACH(QTabBar* tabBar, m_mainWindow->findChildren<QTabBar*>(QString(), Qt::FindDirectChildrenOnly)) { Q_FOREACH(QTabBar* tabBar, m_mainWindow->findChildren<QTabBar*>(QString(), Qt::FindDirectChildrenOnly)) {
bool found = false; bool found = false;
@ -258,7 +260,12 @@ void DockWidgetHelper::activateDock(QDockWidget *p_dock)
break; break;
} }
} }
p_dock->setFocus(); p_dock->setFocus();
if (needUpdateTabBar) {
updateDockWidgetTabBar();
}
} }
const QVector<QDockWidget *> &DockWidgetHelper::getDocks() const const QVector<QDockWidget *> &DockWidgetHelper::getDocks() const