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

QGridLayoutEngine alignment does not respect the size of layout

XMLWordPrintable

      from original reporter:
      Sample application to visualize the bug. (see attached _Linear example)

      SOFTWARE VERSION:
      Qt 4.6.1

      STEPS LEADING TO PROBLEM:
      Example application code is attached but these are the main steps:
      1. Create a vertical QGraphicsLinearLayout
      2. Set fixed width to the layout
      3. Add one or more QGraphicsWidgets into the layout, also with fixed width. The
      width must be smaller than that of the layout's.
      4. For all widgets in the layout, set alignment to Qt::AlignRight.

      EXPECTED OUTCOME:
      All widgets in the layout should be right-aligned to right edge of the layout.

      ACTUAL OUTCOME:
      All widgets in the layout are right-aligned to the right edge of the widest
      widget in the layout, leaving empty unused space on the right.

      FREQUENCY OF OCCURRENCE:
      always

      from me:
      about steps above,
      2. have no effect to the final result actually
      3. affects resizing, but same can be reproduced with quite small children maximum sizes not depending on policy
      attached _Grid example for demo.

      the summary is right alignment just highlights following for our cases:

      • QGridLayoutEngine doesn't respect layout's size when resizing columns: `l->setPreferredWidth(500);' in grid example, but column width is 300 after all
      • QGridLayoutEngine doesn't respect parent widget resize for described cases: there is `parent.resize(550,250);' in grid example, but final result is 500 for width

        1. main.cpp_Linear
          1 kB
          Tatiana Meshkova
        2. main.cpp_Grid
          2 kB
          Tatiana Meshkova
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Unassigned Unassigned
            meshkova Tatiana Meshkova
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes