Quantcast
Channel: Active questions tagged qtquick2 - Stack Overflow
Viewing all articles
Browse latest Browse all 107

Why can I not make a QML RowLayout fill a ColumnLayout's width?

$
0
0

I want to lay out a RowLayout's items to be evenly spaced inside its container. But somehow, setting the RowLayout's Layout.fillWidth property does not have any effect when its parent is a ColumnLayout:

import QtQuick 2.12import QtQuick.Window 2.12import QtQuick.Controls 2.0import QtQuick.Layouts 1.0Window {    width: 640    height: 480    visible: true    title: qsTr("Hello World")    ColumnLayout {        anchors.fill: parent        RowLayout {            Layout.fillWidth: true //this has no effect? why?            Repeater {                model: 3                Button {                    Layout.alignment: Qt.AlignHCenter                }            }        }    }}

Expectation:

enter image description here

Reality:

enter image description here


Viewing all articles
Browse latest Browse all 107

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>