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. ColumnLayout adding borders
Forum Updated to NodeBB v4.3 + New Features

ColumnLayout adding borders

Scheduled Pinned Locked Moved Solved QML and Qt Quick
2 Posts 1 Posters 1.2k 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.
  • YunusY Offline
    YunusY Offline
    Yunus
    wrote on last edited by
    #1

    I have a ColumnLayout and some elements inside:

    ColumnLatyout{
     ....
    }
    

    I want to add some borders around this layout just like in rectangle's border. How to achieve this with a good trick ?

    1 Reply Last reply
    0
    • YunusY Offline
      YunusY Offline
      Yunus
      wrote on last edited by
      #2

      In my case, adding a rectangle parent to this ColumnLayout is not an option. So I have found a solution like this and solved my problem.

      • By the way, all I need was that adding a border around a ColumnLayout.
      ColumnLayout {
                  spacing: 0
                  
                  //top line border            
                  Rectangle{
                      Layout.fillWidth: true
                      height: 1
                      color: "black"
                  }
                  
                  //create row layout for each element inside column layout
                  RowLayout{
                      Rectangle{
                          Layout.fillHeight: true
                          width: 1
                          color: "black"
                      }
                      
                      // YOUR ELEMENTS HERE
                      
                      Rectangle{
                          Layout.fillHeight: true
                          width: 1
                          color: "black"
                      }
                  }
                  .
                  .
                  .
                  
                  //bottom line border
                  Rectangle{
                      Layout.fillWidth: true
                      height: 1
                      color: "black"
                  }        
          }
      
      1 Reply Last reply
      0

      • Login

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