QTabBar: don't overwrite data, fix refactoring error for vertical tabs

Amends 359616066e, which incorrectly
changed

-            tabList[i].minRect = QRect(0, miny, sz.width(), sz.height());
+            tab->data = QRect(0, miny, sz.width(), sz.height());

in the code laying out verticals tabs (correct done for the horizontal
case).

Since QDockWidget uses the user data for tabs to maintain the mapping
between tabs and dock widget, this broke the layout logic.

Fixes: QTBUG-95841
Pick-to: 6.2 6.1
Change-Id: Ie785e1205b426bbc4954b965f619f4c603490f76
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This commit is contained in:
Volker Hilsheimer 2021-08-18 12:54:14 +02:00
parent d2359b2d4e
commit 7188e65077

View File

@ -523,7 +523,7 @@ void QTabBarPrivate::layoutTabs()
y += sz.height();
maxWidth = qMax(maxWidth, sz.width());
sz = q->minimumTabSizeHint(i);
tab->data = QRect(0, miny, sz.width(), sz.height());
tab->minRect = QRect(0, miny, sz.width(), sz.height());
miny += sz.height();
tabChain[tabChainIndex].init();
tabChain[tabChainIndex].sizeHint = tab->maxRect.height();