QDockWidget: fix floating group tab window not having the right title
Before, we were relying on the ZOrderChange event to update the windows title or other flags of a floating tab window when tabs are changed. But this did not catch all the cases. For example, the first tab switch, or when tabs are dragged out. Task-number: QTBUG-53754 Task-number: QTBUG-52107 Change-Id: I1523ce85ceaa95f044bd81f8ccbac0a86978fb33 Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
This commit is contained in:
parent
ac9899b4cb
commit
0c44f26fae
@ -2155,6 +2155,9 @@ bool QDockAreaLayoutInfo::updateTabBar() const
|
||||
if (oldCurrentId > 0 && currentTabId() != oldCurrentId)
|
||||
that->setCurrentTabId(oldCurrentId);
|
||||
|
||||
if (QDockWidgetGroupWindow *dwgw = qobject_cast<QDockWidgetGroupWindow *>(tabBar->parent()))
|
||||
dwgw->adjustFlags();
|
||||
|
||||
//returns if the tabbar is visible or not
|
||||
return ( (gap ? 1 : 0) + tabBar->count()) > 1;
|
||||
}
|
||||
|
@ -1386,8 +1386,6 @@ void QDockWidget::changeEvent(QEvent *event)
|
||||
if (QDockAreaLayoutInfo *info = winLayout->layoutState.dockAreaLayout.info(this))
|
||||
info->updateTabBar();
|
||||
}
|
||||
if (QDockWidgetGroupWindow *p = qobject_cast<QDockWidgetGroupWindow *>(parent()))
|
||||
p->adjustFlags();
|
||||
}
|
||||
#endif // QT_NO_TABBAR
|
||||
break;
|
||||
@ -1477,9 +1475,6 @@ bool QDockWidget::event(QEvent *event)
|
||||
}
|
||||
if (!isFloating() && layout != 0 && onTop)
|
||||
layout->raise(this);
|
||||
if (QDockWidgetGroupWindow *p = qobject_cast<QDockWidgetGroupWindow *>(parent()))
|
||||
p->adjustFlags();
|
||||
|
||||
break;
|
||||
}
|
||||
case QEvent::WindowActivate:
|
||||
|
Loading…
x
Reference in New Issue
Block a user