Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
None
-
6.5.1, 6.6.0
-
None
-
-
2434573f5e4d0ca96a6a5808f3e0191012f83819
Description
QTabBar behaves strangely after commit ca15f650a1a914bb9a41131109c46c4e52c5ebb1
Some tabs in a QTabBar are suddenly positioned to the right instead of the left, and they jump back and forth depending on which tab is selected.
The following seem to fix it for me, but I'm only guessing here:
diff --git a/src/widgets/widgets/qtabbar.cpp b/src/widgets/widgets/qtabbar.cpp index 837874aebf..86ac029a88 100644 --- a/src/widgets/widgets/qtabbar.cpp +++ b/src/widgets/widgets/qtabbar.cpp @@ -570,9 +570,10 @@ void QTabBarPrivate::layoutTabs() leftB->show(); rightB->setGeometry(scrollButtonRightRect); - rightB->setEnabled(last + scrollRect.left() > scrollRect.x() + scrollRect.width()); + rightB->setEnabled(last + -scrollRect.left() > scrollRect.x() + scrollRect.width()); rightB->show(); } else { + scrollOffset = 0; rightB->hide(); leftB->hide(); } @@ -673,7 +674,7 @@ int QTabBarPrivate::hoveredTabIndex() const void QTabBarPrivate::makeVisible(int index) { Q_Q(QTabBar); - if (!validIndex(index)) + if (!validIndex(index) || leftB->isHidden()) return; const QRect tabRect = tabList.at(index)->rect;