Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Wrapping text to next line in Listview delegates
Forum Updated to NodeBB v4.3 + New Features

Wrapping text to next line in Listview delegates

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 4 Posters 5.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mikhas
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0
    • D Offline
      D Offline
      DenisKormalev
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      • A Offline
        A Offline
        andre
        wrote on last edited by
        #3

        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?

        1 Reply Last reply
        0
        • Q Offline
          Q Offline
          qgil
          wrote on last edited by
          #4

          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!

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved