I need to know text rect of QListWidgetItem in mouseMove event. Is it possible?
I need to know text rect of QListWidgetItem in mouseMove event. Is it possible?
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?Originally Posted by wysota
Bookmarks