Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QListWidget adjusting the height of list item to display complete text

QListWidget adjusting the height of list item to display complete text

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 1.2k Views 2 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.
  • A Offline
    A Offline
    arju.ach
    wrote on last edited by
    #1

    Hi,
    We are trying to display some text strings in QListWidget. Each string is dynamically received from backend. We are using boundingRect method of font metrics to determine the list item height to display each string for a fixed width. Unfortunately it is not working properly. Can any one please tell what is the right approach to achieve this using QListWidget.

    Thanks

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @arju.ach said in QListWidget adjusting the height of list item to display complete text:

      unfortunately it is not working properly

      In what way not working ?
      Using font metrics sounds right to me.

      1 Reply Last reply
      0
      • A Offline
        A Offline
        arju.ach
        wrote on last edited by
        #3

        It is not giving the proper height. I am giving the width to list widget width.

        mrjjM 1 Reply Last reply
        0
        • A arju.ach

          It is not giving the proper height. I am giving the width to list widget width.

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @arju.ach
          and you make sure you use same font as it will be painted in?
          Its normally quite exact except for special fonts.

          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