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

Cannot scroll first tab right, using scroll button in QTabBar, when tab size do not fit into visible rect.

    XMLWordPrintable

    Details

    • Platform/s:
      Windows

      Description

      To reproduce an issue, follow next steps:
      1. Open TreeStandardItemModel.zip

      2. Resize window in that way, that first tab do not fit into visible area for tab(part of tab is hiden under scroll butons).

      3. Try to scroll first tab right. Tab does not scroll.

      If you resize window, that tab will be fit to visible area, it will scroll normaly. For clear vision of issue see video issueVideo.mp4

      P.S. This is regression from 5.6 version, as on Qt 5.6 everything works as expected. (I think, the reason is commit a955d9d142b33de7b60b8dfd32a23de9ae528602)

      I made workaround fix for this issue, see code below, but it does not work as in 5.6 version:

      void QTabBarPrivate::_q_scrollTabs()
      {
      ...
       else if (sender == rightB) {
              for (i = 0; i < tabList.count(); ++i) {
      //BEGINING OF WORKAROUND
                  auto tabRect = tabList.at(i).rect;
                  auto containsScrollRect = tabRect.contains(scrollRect);
                  int end = horizontal ? tabRect.right() : tabRect.bottom();
                  if (!containsScrollRect && end > (scrollRect.right() + scrollOffset)) {
      //ENDD OF WORKAROUND
                      makeVisible(i);
                      return;
                  }
              }
          }
      }
      

       

       

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              qt.team.quick.subscriptions Qt Quick and Widgets Team
              Reporter:
              AndriySlisarchuk Andriy Slisarchuk
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:

                  Gerrit Reviews

                  There are no open Gerrit changes