• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KDEUI

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

#include <khelpmenu.h>

Inheritance diagram for KHelpMenu:
Inheritance graph
[legend]

Public Types

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

Public Slots

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

Signals

void showAboutApplication ()
 

Public Member Functions

 KHelpMenu (QWidget *parent=0, const QString &aboutAppText=QString(), bool showWhatsThis=true)
 
 KHelpMenu (QWidget *parent, const KAboutData *aboutData, bool showWhatsThis=true, KActionCollection *actions=0)
 
 ~KHelpMenu ()
 
QAction * action (MenuId id) const
 
KMenu * menu ()
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
 QObject (QObject *parent, const char *name)
 
virtual  ~QObject ()
 
bool blockSignals (bool block)
 
QObject * child (const char *objName, const char *inheritsClass, bool recursiveSearch) const
 
const QObjectList & children () const
 
const char * className () const
 
bool connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const QObject *receiver, const char *method)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method)
 
void dumpObjectInfo ()
 
void dumpObjectTree ()
 
QList< QByteArray > dynamicPropertyNames () const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
T findChild (const QString &name) const
 
QList< T > findChildren (const QRegExp &regExp) const
 
QList< T > findChildren (const QString &name) const
 
bool inherits (const char *className) const
 
void insertChild (QObject *object)
 
void installEventFilter (QObject *filterObj)
 
bool isA (const char *className) const
 
bool isWidgetType () const
 
void killTimer (int id)
 
virtual const QMetaObject * metaObject () const
 
void moveToThread (QThread *targetThread)
 
const char * name () const
 
const char * name (const char *defaultName) const
 
QString objectName () const
 
QObject * parent () const
 
QVariant property (const char *name) const
 
void removeChild (QObject *object)
 
void removeEventFilter (QObject *obj)
 
void setName (const char *name)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const
 
int startTimer (int interval)
 
QThread * thread () const
 

Additional Inherited Members

- Static Public Member Functions inherited from QObject
bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
- Protected Member Functions inherited from QObject
bool checkConnectArgs (const char *signal, const QObject *object, const char *method)
 
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const char *signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const char *signal)
 
int receivers (const char *signal) const
 
QObject * sender () const
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *event)
 
- Static Protected Member Functions inherited from QObject
QByteArray normalizeSignalSlot (const char *signalSlot)
 
- Properties inherited from QObject
 objectName
 

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 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, <someText> );
kmenubar->addMenu(mHelpMenu->menu() );

or if you just want to open a dialog box:

mHelpMenu = new KHelpMenu( this, <someText> );
connect( this, SIGNAL(someSignal()), mHelpMenu,SLOT(aboutKDE()));

IMPORTANT: The first time you use KHelpMenu::menu(), a KMenu 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 simply need to connect the help menu signal showAboutApplication() to your slot.

void MyClass::myFunc()
{
..
KHelpMenu *helpMenu = new KHelpMenu( this );
connect( helpMenu, SIGNAL(showAboutApplication()),
this, SLOT(myDialogSlot()));
..
}
void MyClass::myDialogSlot()
{
<activate your custom dialog>
}
khelpmenu.png
KDE Help Menu
Author
Espen Sand (espen.nosp@m.@kde.nosp@m..org)

Definition at line 110 of file khelpmenu.h.

Member Enumeration Documentation

enum KHelpMenu::MenuId
Enumerator
menuHelpContents 
menuWhatsThis 
menuAboutApp 
menuAboutKDE 
menuReportBug 
menuSwitchLanguage 

Definition at line 168 of file khelpmenu.h.

Constructor & Destructor Documentation

KHelpMenu::KHelpMenu ( QWidget *  parent = 0,
const QString &  aboutAppText = QString(),
bool  showWhatsThis = true 
)
explicit

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 default application dialog box.
showWhatsThisDecides whether a "Whats this" entry will be added to the dialog.

Definition at line 107 of file khelpmenu.cpp.

KHelpMenu::KHelpMenu ( QWidget *  parent,
const KAboutData *  aboutData,
bool  showWhatsThis = true,
KActionCollection *  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.
actionsKActionCollection that is used instead of the standard actions.

Definition at line 117 of file khelpmenu.cpp.

KHelpMenu::~KHelpMenu ( )

Destructor.

Destroys dialogs and the menu pointer retuned by menu

Definition at line 142 of file khelpmenu.cpp.

Member Function Documentation

void KHelpMenu::aboutApplication ( )
slot

Opens an application specific dialog box.

The method will try to open the about box using the following steps:

  • If the showAboutApplication() signal is connected, then it will be called. This means there is an application defined aboutBox.
  • If the aboutData was set in the constructor a KAboutApplicationDialog will be created.
  • Else a default about box using the aboutAppText from the constructor will be created.

Definition at line 270 of file khelpmenu.cpp.

void KHelpMenu::aboutKDE ( )
slot

Opens the standard "About KDE" dialog box.

Definition at line 315 of file khelpmenu.cpp.

QAction * KHelpMenu::action ( MenuId  id) const

Returns the QAction * associated with the given parameter Will return NULL pointers if menu() has not been called.

Parameters
idThe id of the action of which you want to get QAction *

Definition at line 232 of file khelpmenu.cpp.

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 264 of file khelpmenu.cpp.

void KHelpMenu::contextHelpActivated ( )
slot

Activates What's This help for the application.

Definition at line 384 of file khelpmenu.cpp.

KMenu * KHelpMenu::menu ( )

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

The returned menu is configured with an icon, a title and menu entries. Therefore adding the returned pointer to your menu is enougth to have access to the help menu.

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 181 of file khelpmenu.cpp.

void KHelpMenu::reportBug ( )
slot

Opens the standard "Report Bugs" dialog box.

Definition at line 326 of file khelpmenu.cpp.

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.

void KHelpMenu::switchApplicationLanguage ( )
slot

Opens the changing default application language dialog box.

Definition at line 337 of file khelpmenu.cpp.


The documentation for this class was generated from the following files:
  • khelpmenu.h
  • khelpmenu.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:02 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEUI

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

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal