Uploaded image for project: 'Qt Extensions'
  1. Qt Extensions
  2. QTEXT-9

MonthGrid did unnecessary resize of own children

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 5
    • Calendar
    • None

      I have isLandscape property which depends on ApplicatinWindow width and height. In delegates for Month grid I set different width and height, depending on value of that property, something like:

      MonthGrid {
          spacing: isLandscape ? 0 : 10
          delegate: Label {
              width: isLandscape ? 40 : 20
              height: isLandscape ? 16 : 40
      ...
      

      When I resize window, size of delegates should change and it changes. But after several changes, it became wrong and one dimension has improper size. I found that items resized in this function. If I comment code, that does resizing all works fine.

      AFAIK Grid size depends in implicit size of the items. As MonthGrid by default use Grid for it's content, size of the MonthGrid = size of the Grid = size of the items + spacings. So, items resized using their own size... And seems that in my case, some items resized before get proper own size. So, may just remove that resizing? One could use GridLayout if resize needed.

      I have no simple test case for that But, is this resize really needed? As I said, without it all works fine.

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

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            krnekit Nikita Krupenko
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes