390b42c
From 733d1afd03908d695aa8a6518f453b9ff0e5b8a2 Mon Sep 17 00:00:00 2001
390b42c
From: Robert Knight <robertknight@gmail.com>
390b42c
Date: Sun, 20 Apr 2008 16:28:31 +0200
390b42c
Subject: [PATCH 05/13] When tabs are inserted or removed in a QTabBar,
390b42c
 QTabBarPrivate::refresh() is called to update the layout.  If the
390b42c
 tabbar widget is hidden, this just sets a boolean variable
390b42c
 (layoutDirty) and returns, so the parent widget's layout is not
390b42c
 notified about the possible geometry change.
390b42c
390b42c
Prior to Qt 4.4 this was not a problem because the geometry was
390b42c
recalculated in QTabBar::sizeHint() if the layoutDirty variable was
390b42c
set.  In Qt 4.4 however the layout caches size hint information in
390b42c
QWidgetItemV2.  Since the cache information is not invalidated, the
390b42c
layout may end up using out-of-date size hint information to compute
390b42c
the widget size.
390b42c
390b42c
If the QTabBar is empty when QTabBar::sizeHint() is called, it will
390b42c
return a size with a height of 0, which will be kept in the cache and
390b42c
so the tab bar will never be shown.
390b42c
390b42c
This patch fixes the problem by calling updateGeometry() whenever the
390b42c
tab bar's layout is refreshed.
390b42c
390b42c
qt-bugs@ issue : 208185
390b42c
Trolltech task ID : 208349
390b42c
bugs.kde.org number : 159014
390b42c
---
390b42c
 src/gui/widgets/qtabbar.cpp |    2 +-
390b42c
 1 files changed, 1 insertions(+), 1 deletions(-)
390b42c
390b42c
diff --git a/src/gui/widgets/qtabbar.cpp b/src/gui/widgets/qtabbar.cpp
390b42c
index 419d456..41107a0 100644
390b42c
--- a/src/gui/widgets/qtabbar.cpp
390b42c
+++ b/src/gui/widgets/qtabbar.cpp
390b42c
@@ -678,8 +678,8 @@ void QTabBarPrivate::refresh()
390b42c
         layoutTabs();
390b42c
         makeVisible(currentIndex);
390b42c
         q->update();
390b42c
-        q->updateGeometry();
390b42c
     }
390b42c
+    q->updateGeometry();
390b42c
 }
390b42c
 
390b42c
 /*!
390b42c
-- 
390b42c
1.6.5.1
390b42c