Package: qt4-x11 / 4:4.8.7+dfsg-18

0225-invalidate-tabbar-geometry-on-refresh.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
From 733d1afd03908d695aa8a6518f453b9ff0e5b8a2 Mon Sep 17 00:00:00 2001
From: Robert Knight <robertknight@gmail.com>
Date: Sun, 20 Apr 2008 16:28:31 +0200
Subject: [PATCH 05/16] 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
---
 src/gui/widgets/qtabbar.cpp |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/src/gui/widgets/qtabbar.cpp
+++ b/src/gui/widgets/qtabbar.cpp
@@ -723,8 +723,8 @@ void QTabBarPrivate::refresh()
         layoutTabs();
         makeVisible(currentIndex);
         q->update();
-        q->updateGeometry();
     }
+    q->updateGeometry();
 }
 
 /*!