Results 1 to 3 of 3

Thread: QListWidgetItem Text Rect

  1. #1
    Join Date
    Aug 2006
    Posts
    4
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default QListWidgetItem Text Rect

    I need to know text rect of QListWidgetItem in mouseMove event. Is it possible?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QListWidgetItem Text Rect

    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.

  3. #3
    Join Date
    Aug 2006
    Posts
    4
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QListWidgetItem Text Rect

    Quote Originally Posted by wysota
    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?

Similar Threads

  1. Unhandled exception in qatomic
    By NewGuy in forum Qt Programming
    Replies: 14
    Last Post: 23rd July 2013, 09:49
  2. Check Box problem
    By Seema Rao in forum Qt Programming
    Replies: 6
    Last Post: 30th November 2007, 19:32
  3. visible text of textedit
    By regix in forum Qt Programming
    Replies: 3
    Last Post: 26th June 2006, 09:02
  4. QTextEdit API questions (plain text)
    By Gaspar in forum Qt Programming
    Replies: 4
    Last Post: 16th May 2006, 06:03
  5. Problems subclassing QListWidgetItem
    By Morea in forum Qt Programming
    Replies: 2
    Last Post: 8th May 2006, 09:27

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.