org.kde.koala

Class KHelpMenu

public class KHelpMenu extends QObject

This class provides the standard %KDE help menu with the default "about" dialog boxes and help entry. This class is used in KMainWindow so normally you don't need to use this class yourself. However, if you need the help menu or any of its dialog boxes in your code that is not subclassed from KMainWindow you should use this class. The usage is simple:
 mHelpMenu = new KHelpMenu( this,  );
 kmenubar.insertItem(i18n("&Help"), mHelpMenu.menu() );
 
or if you just want to open a dialog box:
 mHelpMenu = new KHelpMenu( this,  );
 connect( this, SIGNAL("someSignal()"), mHelpMenu,SLOT("mHelpMenu.aboutKDE()"));
 
IMPORTANT: The first time you use KHelpMenu.menu(), a KPopupMenu object is allocated. Only one object is created by the class so if you call KHelpMenu.menu() twice or more, the same pointer is returned. The class will destroy the popupmenu in the destructor so do not delete this pointer yourself. The KHelpMenu object will be deleted when its parent is destroyed but you can delete it yourself if you want. The code below will always work.
 MyClass.~MyClass()
 {
   delete mHelpMenu;
 }
 
Using your own "about application" dialog box: The standard "about application" dialog box is quite simple. If you need a dialog box with more functionality you must design that one yourself. When you want to display the dialog you can choose one of two methods. Common for both is that you must make a help menu object with no text argument If the text is missing the default dialog box will not be displayed: Example 1 Using showAboutApplication signal (preferred)
 void MyClass.myFunc()
 {
   ..
   KHelpMenu helpMenu = new KHelpMenu( this );
   connect( helpMenu, SIGNAL("showAboutApplication()"),
          this, SLOT("myDialogSlot()"));
   ..
 }
 void MyClass.myDialogSlot()
 {
   
 }
 
Example 2 Old style - connecting directly to the menu entry.
 void MyClass.myFunc()
 {
   KHelpMenu helpMenu = new KHelpMenu( this );
   KPopupMenu help = mHelpMenu.menu();
   help.connectItem( KHelpMenu.menuAboutApp, this, SLOT("myDialogSlot()") );
 }
 void MyClass.myDialogSlot()
 {
   
 }
 
See KHelpMenuSignals for signals emitted by KHelpMenu

Author: Espen Sand (espen@kde.org)

UNKNOWN: Standard %KDE help menu with dialog boxes.

Field Summary
static intmenuAboutApp
static intmenuAboutKDE
static intmenuHelpContents
static intmenuReportBug
static intmenuWhatsThis
Constructor Summary
protected KHelpMenu(Class dummy)
KHelpMenu(QWidget parent, String aboutAppText, boolean showWhatsThis)
Constructor.
KHelpMenu(QWidget parent, String aboutAppText)
KHelpMenu(QWidget parent)
KHelpMenu()
KHelpMenu(QWidget parent, KAboutData aboutData, boolean showWhatsThis, KActionCollection actions)
Constructor.
KHelpMenu(QWidget parent, KAboutData aboutData, boolean showWhatsThis)
KHelpMenu(QWidget parent, KAboutData aboutData)
Method Summary
voidaboutApplication()
Opens an application specific dialog box.
voidaboutKDE()
Opens the standard "About KDE" dialog box.
voidappHelpActivated()
Opens the help page for the application.
StringclassName()
voidcontextHelpActivated()
Activates What's This help for the application.
voiddispose()
Delete the wrapped C++ instance ahead of finalize()
protected voidfinalize()
Deletes the wrapped C++ instance
booleanisDisposed()
Has the wrapped C++ instance been deleted?
KPopupMenumenu()
Returns a popup menu you can use in the menu bar or where you need it.
QMetaObjectmetaObject()
voidreportBug()
Opens the standard "Report Bugs" dialog box.

Field Detail

menuAboutApp

public static final int menuAboutApp

menuAboutKDE

public static final int menuAboutKDE

menuHelpContents

public static final int menuHelpContents

menuReportBug

public static final int menuReportBug

menuWhatsThis

public static final int menuWhatsThis

Constructor Detail

KHelpMenu

protected KHelpMenu(Class dummy)

KHelpMenu

public KHelpMenu(QWidget parent, String aboutAppText, boolean showWhatsThis)
Constructor.

Parameters: parent The parent of the dialog boxes. The boxes are modeless and will be centered with respect to the parent. aboutAppText User definable string that is used in the application specific dialog box. Note: The help menu will not open this dialog box if you don't define a string. See showAboutApplication() for more information. showWhatsThis Decides whether a "Whats this" entry will be added to the dialog.

UNKNOWN: Constructor.

KHelpMenu

public KHelpMenu(QWidget parent, String aboutAppText)

KHelpMenu

public KHelpMenu(QWidget parent)

KHelpMenu

public KHelpMenu()

KHelpMenu

public KHelpMenu(QWidget parent, KAboutData aboutData, boolean showWhatsThis, KActionCollection actions)
Constructor. This alternative constructor is mainly useful if you want to overide the standard actions (aboutApplication(), aboutKDE(), helpContents(), reportBug, and optionally whatsThis).

Parameters: parent The parent of the dialog boxes. The boxes are modeless and will be centered with respect to the parent. aboutData User and app data used in the About app dialog showWhatsThis Decides whether a "Whats this" entry will be added to the dialog. actions KActionCollection that is used instead of the standard actions.

UNKNOWN: Constructor.

KHelpMenu

public KHelpMenu(QWidget parent, KAboutData aboutData, boolean showWhatsThis)

KHelpMenu

public KHelpMenu(QWidget parent, KAboutData aboutData)

Method Detail

aboutApplication

public void aboutApplication()
Opens an application specific dialog box. The dialog box will display the string that was defined in the constructor. If that string was empty the showAboutApplication() is emitted instead.

UNKNOWN: Opens an application specific dialog box.

aboutKDE

public void aboutKDE()
Opens the standard "About KDE" dialog box.

UNKNOWN: Opens the standard "About KDE" dialog box.

appHelpActivated

public void appHelpActivated()
Opens the help page for the application. The application name is used as a key to determine what to display and the system will attempt to open \/index.html.

UNKNOWN: Opens the help page for the application.

className

public String className()

contextHelpActivated

public void contextHelpActivated()
Activates What's This help for the application.

UNKNOWN: Activates What's This help for the application.

dispose

public void dispose()
Delete the wrapped C++ instance ahead of finalize()

finalize

protected void finalize()
Deletes the wrapped C++ instance

isDisposed

public boolean isDisposed()
Has the wrapped C++ instance been deleted?

menu

public KPopupMenu menu()
Returns a popup menu you can use in the menu bar or where you need it. Note: This method will only create one instance of the menu. If you call this method twice or more the same pointer is returned

UNKNOWN: Returns a popup menu you can use in the menu bar or where you need it.

metaObject

public QMetaObject metaObject()

reportBug

public void reportBug()
Opens the standard "Report Bugs" dialog box.

UNKNOWN: Opens the standard "Report Bugs" dialog box.