Uploaded image for project: 'Qt Design Studio'
  1. Qt Design Studio
  2. QDS-15309

Figma Layout: "Auto" spacing does not convert correctly to Qt Quick

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Not Evaluated
    • QDS 4.7.2
    • QDS 4.7.1
    • Qt-Bridge-Figma
    • None

    Description

      The attached project has 2 frames with the same "active" settings.

       

      Expected outcomes

      For both frames, the red square is aligned with the top of the frame, while the blue square is aligned with the bottom of the frame:

       

      Actual outcomes

      • Frame1 has a gap at the top and bottom (because the Qt Quick ColumnLayout calculates things a bit differently from the Figma layout)
      • Frame2 pushes the blue square out of bounds (because Qt Bridge applied the "inactive" setting, spacing=75)

       

      Possible fix

      1. The "inactive" spacing setting must be ignored
      2. Adding a spacer item in between the items gives the desired result:
        ColumnLayout {
            //spacing: 75 // <-- WRONG
            Rectangle {
                id: redSquare
                // ...
            }
            Item { Layout.fillHeight: true } // <-- Add this
            Rectangle {
                id: greenSquare
                // ...
            }
            Item { Layout.fillHeight: true } // <-- Add this
            Rectangle {
                id: blueSquare
                // ...
            }
        }
        

      Attachments

        1. figma-layout-toedge.png
          figma-layout-toedge.png
          49 kB
        2. LayoutStudy.fig
          25 kB
        3. qds-layout-nottoedge.png
          qds-layout-nottoedge.png
          5 kB

        Issue Links

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

          Activity

            People

              pnd Przemyslaw Lewandowski
              skoh-qt Sze Howe Koh
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes