Positioning text right after word wrapped text



  • @ListView
    {
    anchors.fill: parent
    model: ContactModel {}
    delegate: Item
    {
    width: parent.width
    height: toopis.height + pls.height + 10
    Text
    {
    id: toopis
    anchors.left: parent.left
    anchors.right: bonehead.left
    anchors.rightMargin: 10
    text: name
    color: "black"
    font.pointSize: 24
    wrapMode: Text.WrapAnywhere
    font.family: "Segoe UI"
    }
    Text
    {
    id: bonehead
    anchors.right: parent.right
    text: price
    color: "black"
    horizontalAlignment: Text.AlignRight
    font.pointSize: 24
    font.family: "Segoe UI"
    }
    Text
    {
    id: pls
    anchors.top: toopis.bottom
    color: "#C8C8C8"
    text: "wow"
    font.pointSize: 24
    font.family: "Segoe UI"
    }
    }
    }@
    produces !http://i.imgur.com/79PBgk5.png(bad)!

    However, I want something like this !http://i.imgur.com/FcI5j75.png(want)!
    I've tried using the Flow element to no avail. Nesting the Text element didn't work either. The reason why they can't be part of the same Text element is because of the font differences.



  • Solved. Used html to do the formatting. Rich text will kick in and things will work wonderfully.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.