[Interest] RowLayout with Text with wrap mode

Jérôme Godbout godboutj at amotus.ca
Mon Mar 5 14:42:13 CET 2018


All the *View* type are a bit of a pain with Layout item. You need to specify the height and width properly with the Layout.minimumWidth/Height and maximum values. If you don't need all the animation stuff from ListView, you can do a simple GridLayout and fill the element which would be way simpler and you will have full control on the sizing without the pain.

I for one, try to avoid the *View* element as much as possible. Good GridLayout make it easier and you can even declare the items by specifying the columns and row making a different repeater by row or by column possible.

________________________________
From: Interest <interest-bounces+godboutj=amotus.ca at qt-project.org> on behalf of Igor Mironchik <igor.mironchik at gmail.com>
Sent: Saturday, March 3, 2018 4:18 AM
To: Qt Project
Subject: Re: [Interest] RowLayout with Text with wrap mode

I know that changing RowLayout to simple Row will solve the problem. But
is it possible to solve this with layout?


On 03.03.2018 10:24, Igor Mironchik wrote:
> Hello,
>
> I have a delegate for ListView with RowLayout inside:
>
> RowLayout {
>                 anchors.fill: parent
>                 spacing: 20
>                 width: parent.width
>
>                 ColumnLayout {
>                     id: col
>                     anchors.left: parent.left
>                     spacing: 5
>
>                     Text {
>                         text: type === 0 ? qsTr( "<b>Place: </b>" ) +
> model[ "PlaceRole" ] :
>                             qsTr( "<b>Code: </b>" ) + model[ "CodeRole" ]
>                     }
>
>                     Text {
>                         text: qsTr( "<b>Amount: </b>" ) + model[
> "AmountRole" ]
>                     }
>                 }
>
>                 Text {
>                     text: model[ "DescRole" ]
>                     wrapMode: Text.WordWrap
>                 }
>             }
>
>
> All is fine with except that the last Text item doesn't wrap text. How
> can I workaround it? Thanks.
>

_______________________________________________
Interest mailing list
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/20180305/532873e4/attachment.html>


More information about the Interest mailing list