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

Off-by-one error in QScrollArea::ensureWidgetVisible

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Done
    • Affects Version/s: 5.13.2
    • Fix Version/s: 5.14.2, 5.15.0 Alpha
    • Component/s: Widgets: Layout
    • Labels:
      None
    • Commits:
      ba1e880fbb2aacb550980bc2de35246bdcc38481 (qt/qtbase/5.14)

      Description

      After launching the test program (main.cpp), press B. Notice that there is no 1-pixel gap below the blue rectangle even through I asked for a 1-pixel margin (bottom.png). Now press T. Notice that there is now a 1-pixel gap above the red rectangle (top.png).

      I'm fairly sure (though not certain) that fixing this bug involves inserting + 1 on this line and this line.

      The bug is probably due to this:

      QRect rect;
      rect.bottomRight() - rect.topLeft() != QPoint{rect.width(), rect.height()};
      

      ...which has been the cause of numerous bugs in my own code.

        Attachments

        1. bottom.png
          bottom.png
          39 kB
        2. main.cpp
          2 kB
        3. top.png
          top.png
          39 kB
        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:
            kerndog73 Indi Kernick
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes