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. Putting Repeater and standalone item in GridLayout leads to weird behavior
Forum Updated to NodeBB v4.3 + New Features

Putting Repeater and standalone item in GridLayout leads to weird behavior

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
layoutgridlayout
1 Posts 1 Posters 726 Views 1 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.
  • Stefan Monov76S Offline
    Stefan Monov76S Offline
    Stefan Monov76
    wrote on last edited by
    #1

    My code:

    import QtQuick 2.6
    import QtQuick.Window 2.2
    import QtQuick.Layouts 1.3
    
    Window {
        visible: true
        width: 640
        height: 480
    
        GridLayout {
            id: grid
            anchors.fill: parent
            columns: 6
            Repeater {
                model: 7
                Rectangle {
                    color: "blue"
                    Layout.fillWidth: true
                    Layout.fillHeight: true
                }
            }
            //Rectangle {color: "red"; width: 20; height: 20}
        }
    }
    

    It shows this:

    screenshot

    Which is fine.

    But when you uncomment the line containing color: "red", the layout breaks:

    screenshot

    Any idea why that is and how to fix it?

    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