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

Regression in implicit width calculations of Qt5 Row positioner

    XMLWordPrintable

Details

    Description

      Compared to Qt 4.7 and qt-qml-team version of QtQuick 2.0, Row elements implicit width calculations have changed: now it incorrectly appends one extra spacing value to the total width. Execute attached row_spacing_bug.qml to see the problem, all three positioners shown on the example should look identical with the given parameters. Autotest case below fails on Qt5, but passes on older versions of QtQuick.

      import QtQuick 2.0
      import QtTest 1.0
      
      Row {
          id: row
          spacing: 10
          Repeater {
              model: 5
              Item { width: 50; height: 50 }
          }
          TestCase {
              name: "Row"
              function test_width() {
                  compare(row.width, 5*50 + 4*10); // fail: expected 290, actual 300
              }
          }
      }
      

      Attachments

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

        Activity

          People

            aalpert-nokia Alan Alpert (closed Nokia identity) (Inactive)
            jpetrell Joona Petrell
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes