Results 1 to 6 of 6

Thread: Tooltip-like widget

  1. #1
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    258
    Thanks
    22
    Thanked 19 Times in 16 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Tooltip-like widget

    Hi. Recently I gave opera a try and discovered a nifty Tab-preview widget that is displayed instead of a tooltip when the mouse is hovering over a tab for a certain amount of time.

    tooltip.jpg

    What is the correct way to implement this? Maybe creating a parentless widget and manually displaying it at the position retrieved by the QMouseEvent and destroying it upon a leaveEvent or when a key is pressed? The normal tooltips are pretty limited.

    Thanx in advance
    momesana

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Tooltip-like widget

    Yes, that would be the way to go.
    Tooltips are indeed very limited.

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

    Default Re: Tooltip-like widget

    Using helpEvent would be better. And if you can create a pixmap of the contents you want to display, you can just put it inside a regular tool tip.

  4. #4
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    258
    Thanks
    22
    Thanked 19 Times in 16 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Tooltip-like widget

    Thank you
    I'll try both approaches and see which one best fits the purpose.

  5. #5
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,518 Times in 1,388 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Tooltip-like widget

    This is exactly what QxtToolTip was written for..
    J-P Nurmi

  6. #6
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    258
    Thanks
    22
    Thanked 19 Times in 16 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Tooltip-like widget

    cool.
    Now this is finally a reason to install the Qt Extension Library which I was planning to do anyway

    Thanx alot

Similar Threads

  1. Custom tab widget question
    By PrimeCP in forum Qt Programming
    Replies: 2
    Last Post: 7th August 2007, 12:17
  2. transparent background of the main widget
    By nagpalma in forum Qt Programming
    Replies: 2
    Last Post: 4th May 2007, 18:52
  3. Controlling which widget on top layer?
    By JonathanForQT4 in forum Qt Programming
    Replies: 6
    Last Post: 22nd March 2007, 15:27
  4. Replies: 4
    Last Post: 24th March 2006, 23:50
  5. [Qt 4.1.0] Split a widget on demand
    By Townk in forum Qt Programming
    Replies: 3
    Last Post: 17th February 2006, 15:16

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.