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. [Solved] Dynamically resized rectangle
Qt 6.11 is out! See what's new in the release blog

[Solved] Dynamically resized rectangle

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 2 Posters 2.8k 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    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!

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

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

      1 Reply Last reply
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        Yes, thanks a lot! It works now.

        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