Layout.fillwidth returns 0
-
wrote on 4 Dec 2015, 17:12 last edited by literA2 12 Apr 2015, 17:13
Hi,
I am using a GridLayout with 2 columns, and I want to get the width of the second column which Layout.fillwidth is true, however it returns 0.
Is there any way to determine the width if Layout.fillwidth is set to true? or any other way to implement such where i can determine the second column's width?
GridLayout { id: infoGrid Layout.fillWidth: true columns: 2 columnSpacing: 20 rowSpacing: 5 Text { text: qsTr("Server :") } Text { Layout.fillWidth: true text: qsTr("Server name") } }
Please advise, thanks!
-
wrote on 4 Jan 2016, 13:45 last edited by
Sorry for bumping this, because still I can't figure this out. Thanks.
-
wrote on 4 Jan 2016, 15:55 last edited by
Width of the second column is the width of the "Server name" element. If you are trying to get it in the
Component.onCompleted
, it won't do much because the layout is not calculated yet. -
Width of the second column is the width of the "Server name" element. If you are trying to get it in the
Component.onCompleted
, it won't do much because the layout is not calculated yet. -
wrote on 5 Jan 2016, 12:20 last edited by
That's probably the
implicitWidth
of the largest item.