Wrapping text to next line in Listview delegates



  • I have a Text item as my Listview delegate and want the contained text to wrap to the next line(s) if it is too long to fit in one line. However, the Listview seems to always clip its delegates. Any ideas?



  • You can do it in your delegate, there is nothing how ListView can help you. Just add wrapMode property to your Text item in delegate.



  • And make sure you limit the width of your Text item to the width of the list it is in. How else would the item know where to do the actual wrapping?



  • And make sure you limit the width of your Text item to the width of the list it is in.

    Ah, that was it. Sometimes looking too close to the complex stuff makes me forget about the basic stuff.

    Thanks!


Log in to reply
 

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