[Solved] Dynamically resized rectangle



  • Hi,
    Please, could somebody get me little help or hint ?
    I need to have few rectangles (as Delegates to ListView) which are capable to change height according to lenght of text inside of it and width of whole window (width of ListView = width of app window - 5, or something like that :)

    Is this possible?
    Thanks!



  • You can do something like that
    @
    Component {
    id: listDelegate
    Item {
    id: listDelegateWrapper
    height: textElement.height
    width: listView.width
    Text {
    id: textElement
    height: paintedHeight
    }
    }
    }
    @



  • Yes, thanks a lot! It works now.


Log in to reply
 

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