[Interest] QML | Column | Buttons

Igor Mironchik igor.mironchik at gmail.com
Tue Feb 27 11:24:29 CET 2018


Hi,


On 27.02.2018 13:17, René Hansen wrote:
> You are probably looking to use a *ColumnLayout* and not a *Column*, 
> if you want to use *Layout.fillWidth*.

You are right. This helped. Thanks.

>
> /René
>
> On Tue, 27 Feb 2018 at 10:43 Igor Mironchik <igor.mironchik at gmail.com 
> <mailto:igor.mironchik at gmail.com>> wrote:
>
>     Hello,
>
>     How can I shrink all buttons to the widest width in QML Column?
>
>     I.e. I have:
>
>     Column {
>              anchors.centerIn: parent
>              spacing: 20
>
>              Button {
>                  id: btn1
>                  implicitHeight: appWindow.minimumCtrlHeight
>                  Layout.fillWidth: true
>                  text: qsTr( "Press" )
>              }
>
>              Button {
>                  id: btn2
>                  implicitHeight: appWindow.minimumCtrlHeight
>                  Layout.fillWidth: true
>                  text: qsTr( "Press Press" )
>              }
>
>              Button {
>                  id: btn3
>                  implicitHeight: appWindow.minimumCtrlHeight
>                  Layout.fillWidth: true
>                  text: qsTr( "Press Press Press" )
>              }
>
>     }
>
>     On desktop these buttons are with the same width, but on Android they
>     are as small as possible.
>
>     Thank you.
>
>     _______________________________________________
>     Interest mailing list
>     Interest at qt-project.org <mailto:Interest at qt-project.org>
>     http://lists.qt-project.org/mailman/listinfo/interest
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20180227/bec9114f/attachment.html>


More information about the Interest mailing list