PDA

View Full Version : Solutions for invoking QWhatsThis Mode



ike
28th May 2009, 16:31
Hello -

We have built an application that has numerous screens - some are QDialogs and some are QMainWindows. The application also consists of a little over a dozen individual executables that are launched from a main executable.

Our primary platform right now is UNIX (Solaris) but we're also building on Windows.

We want to make use of QWhatsThis text for an online help solution. The problem - particuarly in Solaris - is that there isn't a "?" at the top of dialogs or main windows to invoke QWhatsThis Mode. We could add a widget that allows the user to invoke QWhatsThis mode but that means adding the widget to hundreds of individual interfaces.

Is there a solution that would allow us to globally add a function that gives the user the ability to invoke QWhatsThis MODE? (Shift+F1 for example)

We want the cursor to change so that when a user passes over a widget that has QWhatsThis text, it is obvious that help exists for that widget. Right now, the user can right-click on a widget and get QWhatsThis text if it exists. But the user has no way of knowing if text exists without trial and error. So, we're looking for the best solution for invoking QWhatsThis Mode.

Appreciate any feedback...

wysota
28th May 2009, 17:34
Shift+F1 should work out of the box. If it doesn't you can create a global shortcut that will call QWhatsThis::enterWhatsThisMode().

ike
28th May 2009, 17:54
Shift+F1 should work out of the box. If it doesn't you can create a global shortcut that will call QWhatsThis::enterWhatsThisMode().

Thank you for the resonse Wysota. As I understand, Shift+F1 works the way it was intended but not the way that we believe is most helpful.

If your cursor is over a widget that has QWhatsThis text behind it and you hit Shift+F1, then the QWhatsThis text will appear. The problem with this is that the user doesn't know ahead of time if QWhatsThis text exists for the widget.

Getting into QWhatsThis MODE seems to be the answer, so that the cursor changes as the user passes over widgets.

I'm not a programmer myself but we have a group of programmers. I will mention your sugestion of "a global shortcut that will call QWhatsThis::enterWhatsThisMode()" and see if we can make this work.

wysota
28th May 2009, 18:15
Getting into QWhatsThis MODE seems to be the answer, so that the cursor changes as the user passes over widgets.

This is exactly what happens on my system (I'm using Linux though) - Shift+F1 brings up the "what's this" mode and when I move the cursor it changes depending on whether a particular widget has some description associated with it.

ike
28th May 2009, 19:00
This is exactly what happens on my system (I'm using Linux though) - Shift+F1 brings up the "what's this" mode and when I move the cursor it changes depending on whether a particular widget has some description associated with it.

That's very interesting. It would be PERFECT for us if Shift+F1 put the application into QWhatsThis MODE.

It doesn't seem to work that way in Solaris. The way it seems to work in Solaris is how it's described on the Qt 4.4 pages, where it says:
http://doc.trolltech.com/4.4/qwhatsthis.html


QWhatsThis provides a single window with an explanatory text that pops up when the user asks "What's This?". The default way for users to ask the question is to move the focus to the relevant widget and press Shift+F1. The help text appears immediately; it goes away as soon as the user does something else. (Note that if there is a shortcut for Shift+F1, this mechanism will not work.) Some dialogs provide a "?" button that users can click to enter "What's This?" mode; they then click the relevant widget to pop up the "What's This?" window. It is also possible to provide a a menu option or toolbar button to switch into "What's This?" mode.

wysota
28th May 2009, 19:10
Maybe that's because I'm using KDE or something... And in fact in some applications I do have the action they are mentioning in the last sentence of the paragraph you quoted. You can use the same action too, it will work exactly the way you want it.

ike
28th May 2009, 19:18
Maybe that's because I'm using KDE or something... And in fact in some applications I do have the action they are mentioning in the last sentence of the paragraph you quoted. You can use the same action too, it will work exactly the way you want it.

Yes - we could add that action too - but it would mean adding it to many, many windows. I was really hoping for a more global solution.

I wonder if the behavior for you is the same for both QDialogs and QMainWindows ?

wysota
28th May 2009, 19:29
Yes - we could add that action too - but it would mean adding it to many, many windows. I was really hoping for a more global solution.

It's enough to install an event filter on the application object and intercept Shift+F1. Then you can toggle the what's this mode.

And if I'm right you don't even need that. If you set up an application global shortcut and add it to any window, it should stay active for all others too - see QShortcut::context.

ike
28th May 2009, 20:07
It's enough to install an event filter on the application object and intercept Shift+F1. Then you can toggle the what's this mode.

And if I'm right you don't even need that. If you set up an application global shortcut and add it to any window, it should stay active for all others too - see QShortcut::context.

One of our developers just created a test executable with the global shortcut for Shift+F1 and it worked perfectly. It appears to be very easy to apply this throughout our product.

Many thanks for your time and suggestions !

wysota
28th May 2009, 20:18
No problem. That's what we're here for :cool: