PDA

View Full Version : QListWidgetItem Text Rect



js67257
21st August 2006, 16:25
I need to know text rect of QListWidgetItem in mouseMove event. Is it possible?

wysota
21st August 2006, 18:52
Not out of the box. You'd have to repeat calculations which are made in QItemDelegate while drawing the item. It might be easier to try to subclass the delegate and fetch data from drawDisplay() -- the rect parameter should have the value you need.

js67257
22nd August 2006, 12:02
Not out of the box. You'd have to repeat calculations which are made in QItemDelegate while drawing the item. It might be easier to try to subclass the delegate and fetch data from drawDisplay() -- the rect parameter should have the value you need.

I made something like this in paint of QItemDelegate. There is another problem for me. I didnt find the way to know current item which I paint and had to store Text Rect info in Qt::UserRole data. I dont think thats good solution. Is there another way?