Results 1 to 4 of 4

Thread: enable all Tooltips

  1. #1
    Join Date
    Mar 2007
    Posts
    16
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question enable all Tooltips

    Is it possible to turn all tool tips on and off globally in an application?
    If so how?

  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: enable all Tooltips

    am not sure if it possible.
    But you can try catching the tooltip event in QWidget::event using QEvent::ToolTip, and ignore the event.
    hope this helps

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

    Default Re: enable all Tooltips

    Furthermore, installing an event filter on the application object gives you access to all events of the whole application. Notice also Qt::WA_AlwaysShowToolTips.
    J-P Nurmi

  4. #4
    Join Date
    Mar 2007
    Posts
    16
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Thumbs up Re: enable all Tooltips

    Thanks....

    For future reference for others this is what I did.

    I add this function to my app...
    Qt Code:
    1. bool MainWin::eventFilter(QObject *obj, QEvent *event)
    2. {
    3. if(cbToolTips->isChecked() == true)
    4. {
    5. if (event->type() == QEvent::ToolTip)
    6. {
    7. return true;
    8. }
    9. else
    10. {
    11. return QMainWindow::eventFilter(obj, event);
    12. }
    13. }
    14. else
    15. {
    16. return QMainWindow::eventFilter(obj, event);
    17. }
    18. }
    To copy to clipboard, switch view to plain text mode 
    Note I am using a CheckBox to determine if tool tips need to be disabled.

    In the header file I add this..
    Qt Code:
    1. protected:
    2. bool eventFilter(QObject *obj, QEvent *ev);
    To copy to clipboard, switch view to plain text mode 

    Then I install the filter like this
    Qt Code:
    1. qApp->installEventFilter(this);
    To copy to clipboard, switch view to plain text mode 

    I hope this helps others.

Similar Threads

  1. how to enable touch screen in qt/embedded
    By sar_van81 in forum Qt for Embedded and Mobile
    Replies: 8
    Last Post: 25th March 2011, 10:44
  2. How to enable QWS_IM in qte-3.3.5 ?
    By kevin lin in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 29th June 2006, 06:40
  3. Tooltips for QListViewItems (QT3)?
    By gadnio in forum Newbie
    Replies: 3
    Last Post: 13th March 2006, 17:02
  4. toolTips?
    By mickey in forum Qt Programming
    Replies: 11
    Last Post: 23rd February 2006, 19:10
  5. Tooltips & Qt4 tree views
    By yogeshm02 in forum Newbie
    Replies: 7
    Last Post: 17th January 2006, 15:12

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.