Arquitectura de KDE - Suministro de ayuda online
La construcción de un programa facil e intuitivo de usar implica un amplio rango de facilidades que por lo general se llama ayuda online. La ayuda online persigue varios objetivos parcialmente contradictorios: por un lado, debería dar respuesta a la pregunta del usuario "¿Como puedo realizar una cierta tarea?", pero por el otro lado debería ayudar al usuario que explora la aplicación y se encuentra con caracteristicas que aun desconoce. Es importante reconocer que esta situacion sólo puede ser tratada ofreciendo varios niveles de ayuda:
El problema de este método es que el usuario no puede saber cuando un widget proporciona ayuda o no. Cuando el usuario activa el boton de signo de interrogación, y no obtiene ninguna ayuda cuando pulsa sobre un elemento de la interfaz de usuario, se frustrará rapidamente.
La ventaja de "¿Qué es esto?"
of "What's this?" help windows as provided by Qt and KDE is that they can contain rich text, i.e. the may contain different fonts, bold and italic text and even images and tables.
From the programmer's point of view, Qt provides an easy to use API for online
help. To assign a tooltip to widget, simply use its setToolTip() method.
widget->setToolTip(i18n("This widget does something."))
If the menu bars and tool bars are created using the action pattern, the string used as tooltip is derived from the first argument of the KAction constructor:
action = new KAction(i18n("&Delete"), "editdelete",
SHIFT+Key_Delete, actionCollection(), "del")
Here it is also possible to assign a text which is shown in the status bar when the respective menu item is highlighted:
action->setStatusText(i18n("Deletes the marked file"))
The API for "What's this?' help is very similar. In dialogs, use the following code:
widget->setWhatsThis(i18n("<qt>This demonstrates Qt's"
For menu items, use
action->setWhatsThis(i18n("Deletes the marked file"))
The invocation of khelpcenter is encapsulated in the KToolInvocation class. In order to show the manual of your application, just use the static method:
KToolInvocation::invokeHelp()
This displays the first page with the table of contents. When you want to display only a certain section of the manual, you can give an additional argument to invokeHelp() determining the anchor which the browser jumps to.
Initial Author: Bernd Gehrmann