Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-113345

Regression after QTabBar scroll changes

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P1: Critical
    • None
    • 6.5.1, 6.6.0
    • None
    • Linux/X11
    • 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.

      https://code.qt.io/cgit/qt/qtbase.git/commit/src/widgets/widgets/qtabbar.cpp?id=ca15f650a1a914bb9a41131109c46c4e52c5ebb1

      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;
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            vhilshei Volker Hilsheimer
            jonaski Jonas Kvinge
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes