When tabs are inserted or removed in a QTabBar, QTabBarPrivate::refresh() is called...
authorRobert Knight <robertknight@gmail.com>
Sun, 20 Apr 2008 14:28:31 +0000 (16:28 +0200)
committerFelix Geyer <fgeyer@debian.org>
Sun, 14 Jul 2019 10:19:27 +0000 (11:19 +0100)
commit498983b83de96d57ca27370f50b702343031dc75
tree8bd7f1a1d77b19fd9c3cea44501a2b2ddf96e6d3
parent374134290d13493d5f10753fb85a77093699f152
When tabs are inserted or removed in a QTabBar, QTabBarPrivate::refresh() is called to update the layout. If the tabbar widget is hidden, this just sets a boolean variable (layoutDirty) and returns, so the parent widget's layout is not notified about the possible geometry change.

Prior to Qt 4.4 this was not a problem because the geometry was
recalculated in QTabBar::sizeHint() if the layoutDirty variable was
set.  In Qt 4.4 however the layout caches size hint information in
QWidgetItemV2.  Since the cache information is not invalidated, the
layout may end up using out-of-date size hint information to compute
the widget size.

If the QTabBar is empty when QTabBar::sizeHint() is called, it will
return a size with a height of 0, which will be kept in the cache and
so the tab bar will never be shown.

This patch fixes the problem by calling updateGeometry() whenever the
tab bar's layout is refreshed.

qt-bugs@ issue : 208185
Trolltech task ID : 208349
bugs.kde.org number : 159014

Gbp-Pq: Name 0225-invalidate-tabbar-geometry-on-refresh.patch
src/gui/widgets/qtabbar.cpp