• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeui
 

tdeui

Public Types | Public Slots | Signals | Public Member Functions | Protected Member Functions | List of all members
KHelpMenu Class Reference

#include <khelpmenu.h>

Inherits TQObject.

Public Types

enum  MenuId {
  menuHelpContents = 0 , menuWhatsThis = 1 , menuAboutApp = 2 , menuAboutKDE = 3 ,
  menuReportBug = 4 , menuSwitchLanguage = 5
}
 

Public Slots

void appHelpActivated ()
 
void contextHelpActivated ()
 
void aboutApplication ()
 
void aboutKDE ()
 
void reportBug ()
 
void switchApplicationLanguage ()
 

Signals

void showAboutApplication ()
 

Public Member Functions

 KHelpMenu (TQWidget *parent=0, const TQString &aboutAppText=TQString::null, bool showWhatsThis=true)
 
 KHelpMenu (TQWidget *parent, const TDEAboutData *aboutData, bool showWhatsThis=true, TDEActionCollection *actions=0)
 
 ~KHelpMenu ()
 
TDEPopupMenu * menu ()
 

Protected Member Functions

virtual void virtual_hook (int id, void *data)
 

Detailed Description

Standard KDE help menu with dialog boxes.

This class provides the standard KDE help menu with the default "about" dialog boxes and help entry.

This class is used in TDEMainWindow 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 TDEMainWindow you should use this class.

The usage is simple:

mHelpMenu = new KHelpMenu( this, <someText> );
kmenubar->insertItem(i18n("&Help"), mHelpMenu->menu() );
KHelpMenu::KHelpMenu
KHelpMenu(TQWidget *parent=0, const TQString &aboutAppText=TQString::null, bool showWhatsThis=true)
Constructor.
Definition: khelpmenu.cpp:66

or if you just want to open a dialog box:

mHelpMenu = new KHelpMenu( this, <someText> );
connect( this, TQ_SIGNAL(someSignal()), mHelpMenu,TQ_SLOT(mHelpMenu->aboutKDE()));

IMPORTANT: The first time you use KHelpMenu::menu(), a TDEPopupMenu 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, TQ_SIGNAL(showAboutApplication()),
this, TQ_SLOT(myDialogSlot()));
..
}
void MyClass::myDialogSlot()
{
<activate your custom dialog>
}
KHelpMenu
Standard KDE help menu with dialog boxes.
Definition: khelpmenu.h:132
KHelpMenu::showAboutApplication
void showAboutApplication()
This signal is emitted from aboutApplication() if no "about application" string has been defined.

Example 2 Old style - connecting directly to the menu entry.

void MyClass::myFunc()
{
KHelpMenu *helpMenu = new KHelpMenu( this );
TDEPopupMenu *help = mHelpMenu->menu();
help->connectItem( KHelpMenu::menuAboutApp, this, TQ_SLOT(myDialogSlot()) );
}
void MyClass::myDialogSlot()
{
<activate your custom dialog>
}
TDEPopupMenu
A menu with title items.
Definition: tdepopupmenu.h:123
Author
Espen Sand (espen.nosp@m.@kde.nosp@m..org)

Definition at line 131 of file khelpmenu.h.

Member Enumeration Documentation

◆ MenuId

enum KHelpMenu::MenuId

Definition at line 136 of file khelpmenu.h.

Constructor & Destructor Documentation

◆ KHelpMenu() [1/2]

KHelpMenu::KHelpMenu ( TQWidget *  parent = 0,
const TQString &  aboutAppText = TQString::null,
bool  showWhatsThis = true 
)

Constructor.

Parameters
parentThe parent of the dialog boxes. The boxes are modeless and will be centered with respect to the parent.
aboutAppTextUser 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.
showWhatsThisDecides whether a "Whats this" entry will be added to the dialog.

Definition at line 66 of file khelpmenu.cpp.

◆ KHelpMenu() [2/2]

KHelpMenu::KHelpMenu ( TQWidget *  parent,
const TDEAboutData *  aboutData,
bool  showWhatsThis = true,
TDEActionCollection *  actions = 0 
)

Constructor.

This alternative constructor is mainly useful if you want to overide the standard actions (aboutApplication(), aboutKDE(), helpContents(), reportBug, and optionally whatsThis).

Parameters
parentThe parent of the dialog boxes. The boxes are modeless and will be centered with respect to the parent.
aboutDataUser and app data used in the About app dialog
showWhatsThisDecides whether a "Whats this" entry will be added to the dialog.
actionsTDEActionCollection that is used instead of the standard actions.

Definition at line 77 of file khelpmenu.cpp.

◆ ~KHelpMenu()

KHelpMenu::~KHelpMenu ( )

Destructor.

Destroys dialogs and the menu pointer retuned by menu

Definition at line 102 of file khelpmenu.cpp.

Member Function Documentation

◆ aboutApplication

void KHelpMenu::aboutApplication ( )
slot

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.

Definition at line 193 of file khelpmenu.cpp.

◆ aboutKDE

void KHelpMenu::aboutKDE ( )
slot

Opens the standard "About KDE" dialog box.

Definition at line 237 of file khelpmenu.cpp.

◆ appHelpActivated

void KHelpMenu::appHelpActivated ( )
slot

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 <appName>/index.html.

Definition at line 187 of file khelpmenu.cpp.

◆ contextHelpActivated

void KHelpMenu::contextHelpActivated ( )
slot

Activates What's This help for the application.

Definition at line 305 of file khelpmenu.cpp.

◆ menu()

TDEPopupMenu * KHelpMenu::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

Definition at line 112 of file khelpmenu.cpp.

◆ reportBug

void KHelpMenu::reportBug ( )
slot

Opens the standard "Report Bugs" dialog box.

Definition at line 248 of file khelpmenu.cpp.

◆ showAboutApplication

void KHelpMenu::showAboutApplication ( )
signal

This signal is emitted from aboutApplication() if no "about application" string has been defined.

The standard application specific dialog box that is normally activated in aboutApplication() will not be displayed when this signal is emitted.

◆ switchApplicationLanguage

void KHelpMenu::switchApplicationLanguage ( )
slot

Opens changing default application language dialog box.

Definition at line 258 of file khelpmenu.cpp.

◆ virtual_hook()

void KHelpMenu::virtual_hook ( int  id,
void *  data 
)
protectedvirtual

Definition at line 317 of file khelpmenu.cpp.


The documentation for this class was generated from the following files:
  • khelpmenu.h
  • khelpmenu.cpp

tdeui

Skip menu "tdeui"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdeui

Skip menu "tdeui"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeui by doxygen 1.9.4
This website is maintained by Timothy Pearson.