Results 1 to 2 of 2

Thread: Context sensitive help on OS X

  1. #1
    Join Date
    Nov 2009
    Qt products
    MacOS X Unix/X11 Windows

    Question Context sensitive help on OS X

    For nearly all of the widgets in my application I have set the whatsThis property. For Windows, my understanding is that I don't need to do anything special to get context sensitive help: just highlight the widget and press Shift+F1. However, I need to accommodate OS X and LINUX users as well. As it stands, I have a checkable button on a toolbar that I have designated to toggle the display of context sensitive help for OS X. The relevant code is:

    Qt Code:
    1. void myClass::contextHelp()
    2. {
    3. if (ui->toolbarActionContextHelp->isChecked())
    4. {
    5. QWhatsThis::enterWhatsThisMode();
    6. }
    7. else
    8. {
    9. QWhatsThis::leaveWhatsThisMode();
    10. }
    11. }
    13. void myClass::on_toolbarActionContextHelp_triggered()
    14. {
    15. contextHelp();
    16. }
    To copy to clipboard, switch view to plain text mode 

    This is very rudimentary and doesn't function well: I can click on the toolbarActionContextHelp button, which toggles the button to a checked state, and then move over a given widget in my app and left click on it. If that widget contains whatsThis content, it is displayed per usual. However, I cannot then select a second widget (by left clicking) to display its whatsThis contents because the action of left clicking (again) makes my app leave context sensitive mode.

    Ultimately what I would want is the following: if the toolbarActionContextHelp button is checked, I would like to be able to simply mouse-over (and not left click) a widget to bring up its context sensitive help. Then to turn it off, I would simply toggle the toolbarActionContextHelp button again.

    Q1: Is there a way that I can programmatically set this for all widgets in my application?

    Q2: In general, is there a better way to handle this for OS X?

    Finally, I obviously don't want to disrupt the native context sensitive help available in Windows via Shift+F1.

    Thanks for your help!

  2. #2
    Join Date
    Jan 2006
    Thanked 52 Times in 52 Posts
    MacOS X Unix/X11

    Default Re: Context sensitive help on OS X

    Use QAction * QWhatsThis::createAction ( QObject * parent = 0 ) [static]
    It's nice to be important but it's more important to be nice.

Similar Threads

  1. Context Menu for specific items in a Tree Widget
    By manekineko in forum Qt Programming
    Replies: 0
    Last Post: 16th November 2009, 02:46
  2. Context Menu's submenu doesn't appear
    By DancingFirefly in forum Qt Programming
    Replies: 0
    Last Post: 19th August 2009, 21:32
  3. Multiple Context Menus
    By mclark in forum Qt Programming
    Replies: 3
    Last Post: 24th December 2008, 20:55
  4. Replies: 4
    Last Post: 25th June 2007, 21:40
  5. Context sensitive help
    By jpn in forum Qt Programming
    Replies: 4
    Last Post: 10th February 2007, 00:27

Tags for this Thread


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.