Results 1 to 5 of 5

Thread: Tooltip erraticity with QGraphicsPixmapItem

  1. #1
    Join Date
    Jul 2008
    Location
    East Coast, USA
    Posts
    40
    Thanks
    6
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Tooltip erraticity with QGraphicsPixmapItem

    Firstly, I glad I found this forum. It has answers to almost every question I had with QT. Its great to find this community.

    One question I could not find the answer to is this:

    I have a bunch of QGraphicsPixmapItems (subclassed to my own class) inserted into a QGraphicsScene and I set their tooltips.

    The behavior I expected is a tooltip popup on mouse hover over an item, and a quick switch to the next tool tip when the mouse hovers over another item.

    The actual behavior is erratic. Sometimes it will work as expected, but sometimes even when I move the mouse to another item, the old tool tip remains.

    Is there a setting I have to play with somewhere, or is this a more fundamental windowing system problem?

    I am on Mac OS X, Qt version 4.4.0 g++ version i686-apple-darwin9-g++-4.0.1

    Thanks
    -K

  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: Tooltip erraticity with QGraphicsPixmapItem

    Unfortunately there are no good ways to overcome the problem. The only thing you can do is to catch the event responsible for tooltips and handle it yourself (it is "help event"), but I can't guarantee that the delay is not caused by a late delivery of the help event itself.

  3. The following user says thank you to wysota for this useful post:

    kghose (10th July 2008)

  4. #3
    Join Date
    Jul 2008
    Location
    East Coast, USA
    Posts
    40
    Thanks
    6
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Question Re: Tooltip erraticity with QGraphicsPixmapItem

    Thanks for your reply. Could I also force a tooltip showing from the hoverevents? I found those to be deterministic.

    Thanks
    -K

  5. #4
    Join Date
    Sep 2007
    Location
    Rome, GA
    Posts
    199
    Thanks
    14
    Thanked 41 Times in 35 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Tooltip erraticity with QGraphicsPixmapItem

    I don't have any advice, I just wanted to thank you for introducing me to such a cool word - erraticity - gonna start using that one. :-)

  6. #5
    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: Tooltip erraticity with QGraphicsPixmapItem

    If you implement it yourself, then sure - the QToolTip class (and QTimer, I guess) is your friend. Just be aware there will be some cases where relying on the hover event won't work.

Similar Threads

  1. Hot to set the tooltip of button
    By santosh.kumar in forum Qt Programming
    Replies: 3
    Last Post: 1st November 2007, 12:07

Tags for this Thread

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.