Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Best way to left/right align objects
Forum Updated to NodeBB v4.3 + New Features

Best way to left/right align objects

Scheduled Pinned Locked Moved Solved QML and Qt Quick
4 Posts 2 Posters 792 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mark81
    wrote on last edited by
    #1

    I'm designing a QML page like the usual "Android settings page" (i.e. https://goo.gl/images/Mk3PHs).
    I'm wondering which is the best way to align objects to the left and right of the container.

    I can do it manually with anchors, but it will a pain if I need to change the order of the items (I need to change top and bottom anchorages).

    GridLayout seems a good fit, where the cell size is the smallest one (i.e. the objects on the right) and the left items spans over the N-1 columns.

    Any other suggestion?

    raven-worxR 1 Reply Last reply
    0
    • M Mark81

      I'm designing a QML page like the usual "Android settings page" (i.e. https://goo.gl/images/Mk3PHs).
      I'm wondering which is the best way to align objects to the left and right of the container.

      I can do it manually with anchors, but it will a pain if I need to change the order of the items (I need to change top and bottom anchorages).

      GridLayout seems a good fit, where the cell size is the smallest one (i.e. the objects on the right) and the left items spans over the N-1 columns.

      Any other suggestion?

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @Mark81
      My suggestion:
      dont create a whole page as one component.
      Create each line as a single component and use anchors inside each of them.

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      3
      • M Offline
        M Offline
        Mark81
        wrote on last edited by
        #3

        Good point. In this case what the best choice for the container of each single item component? An Item ?

        raven-worxR 1 Reply Last reply
        0
        • M Mark81

          Good point. In this case what the best choice for the container of each single item component? An Item ?

          raven-worxR Offline
          raven-worxR Offline
          raven-worx
          Moderators
          wrote on last edited by
          #4

          @Mark81
          for example.
          Or a Rectangle if you want to choose a border and/or background color

          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
          If you have a question please use the forum so others can benefit from the solution in the future

          1 Reply Last reply
          3

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved