QListWidget adjusting the height of list item to display complete text
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.
unfortunately it is not working properly
In what way not working ?
Using font metrics sounds right to me.
It is not giving the proper height. I am giving the width to list widget width.
and you make sure you use same font as it will be painted in?
Its normally quite exact except for special fonts.