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. How to align items in Row like space-between in css
Forum Updated to NodeBB v4.3 + New Features

How to align items in Row like space-between in css

Scheduled Pinned Locked Moved Solved QML and Qt Quick
2 Posts 1 Posters 328 Views
  • 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.
  • H Offline
    H Offline
    HarryC
    wrote on last edited by HarryC
    #1

    I tried to find a similar topic, but couldn't find it.

    I am trying to align 2 items start and end.

    I used anchors stuff(anchors.right, anchors.margin) on my second item, but it didn't work.
    What is a good way to align as follows;

    +-------------------------+
    |Text             ComboBox|
    +-------------------------+
    
    Row {
        Text {
            anchors.verticalCenter: parent.verticalCenter
            ......
        }
        ComboBox {
            width: 100
            anchors.right: parent.right // it breaks whole alignment of Row block
             ......
        }
    }
    
    1 Reply Last reply
    0
    • H Offline
      H Offline
      HarryC
      wrote on last edited by HarryC
      #2

      I have fixed this using RowLayout instead of Row.
      After changing to RowLayout

      Layout.alignment: Qt.AlignLeft // first item
      Layout.alignment: Qt.AlignRight // second item
      
      1 Reply Last reply
      1

      • Login

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