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)
committerRaspbian forward porter <root@raspbian.org>
Sun, 14 Jun 2015 16:38:43 +0000 (16:38 +0000)
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

index 4e14beec0a4c61128a4755e5aca20eb17f1dcf91..86dbb0454e89d0f10a873a72caa9e5a7dc145c6e 100644 (file)
@@ -723,8 +723,8 @@ void QTabBarPrivate::refresh()
         layoutTabs();
         makeVisible(currentIndex);
         q->update();
-        q->updateGeometry();
     }
+    q->updateGeometry();
 }
 
 /*!