Results 1 to 5 of 5

Thread: Qt 4.6 in Windows XP -- Tooltips Sometimes Appear with No Text -- Why? How to fix?

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

    Default Qt 4.6 in Windows XP -- Tooltips Sometimes Appear with No Text -- Why? How to fix?

    Tooltips are not rendering properly in Win XP (sometimes). I'll hover over a button, and I will see the appropriate tooltip, then a moment later I will hover over it again and a blank tooltip will come up. The tooltip continues to be wide enough to display all the text that is in it, although its height seems to have reduced by 50% and there doesn't appear to be any text in it. I am using a stylesheet for tooltips which looks like this:

    Qt Code:
    1. border: 2px solid darkkhaki;
    2. padding: 5px;
    3. border-radius: 3px;
    4. opacity: 200;
    5. color: black;
    6. }
    To copy to clipboard, switch view to plain text mode 

    It's very annoying and I can't seem to get it to work reliably. I am not using a custom QToolTip object.

    Note: when I build my app and run it in CentOS the tooltips always work. When I build it and run in it Windows XP tooltips only occasionally work.

    Thanks in advance for any help you can offer. If this is a known bug, is there a workaround? Otherwise I am just going to have to shut off all the tooltips in my application.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Qt 4.6 in Windows XP -- Tooltips Sometimes Appear with No Text -- Why? How to fix

    Have you tried removing your style sheet as an experiment?

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

    Default Re: Qt 4.6 in Windows XP -- Tooltips Sometimes Appear with No Text -- Why? How to fix

    I've tried removing the style for the QToolTip but not the style for the entire screen. I can give that a shot though.

  4. #4
    Join Date
    Aug 2012
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt 4.6 in Windows XP -- Tooltips Sometimes Appear with No Text -- Why? How to fix

    It's been a couple months but I have finally gotten back to looking at this bug, and I have learned more. This appears to be a Qt Bug. Qt appears to be *sometimes* computing the size of the tooltip box *before* the styles have been applied. So if I specify a red border and no other styles, my tooltips appear fine every time. But if I add, say 10px of padding, the tooltip box now appears blank because it hasn't been sized to be big enough to accommodate the font plus 20 additional pixels of width and height, and as a result, none of the text actually renders inside the tooltip box. This only appears to happen in WinXP.

    The only workaround available to me is to remove all tooltip styling. It's the only way I can ensure that the application can properly render the tooltips whether I build it in CentOS or Win XP.

    Occasionally Qt properly computes the tooltip size correctly, and then I can see the tooltip, but it is sporadic and random--I might mouse off of a control and then mouse back on and suddenly the tooltip appears wrongly sized and blank when it was visible just moments before.

    Other people reporting similar problem:

    https://bugs.launchpad.net/mixxx/+bug/712718

  5. #5
    Join Date
    Feb 2010
    Posts
    96
    Thanks
    4
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt 4.6 in Windows XP -- Tooltips Sometimes Appear with No Text -- Why? How to fix

    You can setGeometry for the tool tip to give it extra padding.

Similar Threads

  1. Replies: 1
    Last Post: 30th June 2010, 14:13
  2. enable all Tooltips
    By clive in forum Qt Programming
    Replies: 3
    Last Post: 2nd January 2008, 11:08
  3. toolTips?
    By mickey in forum Qt Programming
    Replies: 11
    Last Post: 23rd February 2006, 19:10
  4. Tooltips on QActions
    By drhex in forum Newbie
    Replies: 1
    Last Post: 8th February 2006, 18:05
  5. Tooltips in QTableWidgetItem
    By Arthur in forum Newbie
    Replies: 2
    Last Post: 26th January 2006, 15:47

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
  •  
Qt is a trademark of The Qt Company.