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

    • Windows
    • 06b1e404c936847038cc7a371720b05f31532b6a (qt/qtbase/dev) b28c6d73c2ee3b0e7986a8ed58ae6461be1883de (qt/qtbase/6.2) a9e83563dfaa02791682ad5c601b894596822223 (qt/tqtc-qtbase/5.15) bed5306eaf91b219c27ea7c2966519aa79e44039 (qt/qtbase/6.1)

    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

        1. issueVideo.mp4
          352 kB
          Andriy Slisarchuk
        2. TreeStandardItemModel.zip
          3 kB
          Andriy Slisarchuk

        Issue Links

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

          Activity

            People

              vhilshei Volker Hilsheimer
              AndriySlisarchuk Andriy Slisarchuk
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: