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: Unresolved
    • Not Evaluated
    • None
    • 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. LayoutStudy.fig
          25 kB
          Sze Howe Koh
        2. figma-layout-toedge.png
          49 kB
          Sze Howe Koh
        3. qds-layout-nottoedge.png
          5 kB
          Sze Howe Koh
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            algerman Aleksei German
            skoh-qt Sze Howe Koh
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes