Results 1 to 3 of 3

Thread: Is the QToolTip::showText Bug?

  1. #1
    Join Date
    Mar 2009
    Location
    Nanjing,China
    Posts
    40
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Is the QToolTip::showText Bug?

    Now I want to show some tips when my mouse hovered on some QTreeWidgetItem in QTreeWidget.

    but the tips sometimes show and change well,but sometimes it does not changed,although
    I have to change the position.
    The porblem is:
    when the mouse hovered on the first item,it should be show like "TipA";
    and the second third item also show the tip "TipA".but the position should be changed!

    but now,it didn't changed!

    In QTooltip::showText,I find this code:
    Qt Code:
    1. else if (!QTipLabel::instance->fadingOut){
    2. // If the tip has changed, reuse the one
    3. // that is showing (removes flickering)
    4. if (QTipLabel::instance->tipChanged(pos, text, w)){
    5. QTipLabel::instance->reuseTip(text);
    6. QTipLabel::instance->setTipRect(w, rect);
    7. QTipLabel::instance->placeTip(pos, w);
    8. }
    9. return;
    10. }
    To copy to clipboard, switch view to plain text mode 

    if my tip contents didnot changed,it will be returned direct when I use QToolTip::showText();

    so in function tipChanged,should add some judgement like pos!

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Is the QToolTip::showText Bug?

    I guess thats the behaviour.
    Tooltip doesnt change if text hasnt changed.
    If you want to update the tooltip rapidly, you will need to override the mousemoveevent and show tooltip yourself.

  3. #3
    Join Date
    Mar 2009
    Location
    Nanjing,China
    Posts
    40
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Is the QToolTip::showText Bug?

    Quote Originally Posted by aamer4yu View Post
    I guess thats the behaviour.
    Tooltip doesnt change if text hasnt changed.
    If you want to update the tooltip rapidly, you will need to override the mousemoveevent and show tooltip yourself.
    yes,I have to QToolTip::hideText() everytime when I user QToolTip::showText()

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.