|
Krita Source Code Documentation
|
Standard KDE help menu with dialog boxes. More...
#include <khelpmenu.h>
Inheritance diagram for KisKHelpMenu: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 | |
| QAction * | action (MenuId id) const |
| KisKHelpMenu (QWidget *parent, const KAboutData &aboutData, bool showWhatsThis=true) | |
| KisKHelpMenu (QWidget *parent=0, const QString &aboutAppText=QString(), bool showWhatsThis=true) | |
| QMenu * | menu () |
| ~KisKHelpMenu () override | |
Private Slots | |
| void | dialogFinished () |
| void | menuDestroyed () |
| void | timerExpired () |
Private Attributes | |
| KisKHelpMenuPrivate *const | d |
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 KisKMainWindow 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 KisKMainWindow you should use this class.
The usage is simple:
or if you just want to open a dialog box:
IMPORTANT: The first time you use KisKHelpMenu::menu(), a QMenu object is allocated. Only one object is created by the class so if you call KisKHelpMenu::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 KisKHelpMenu object will be deleted when its parent is destroyed but you can delete it yourself if you want. The code below will always work.
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.
[KDE Action Restrictions][$i] actions/help_contents=false actions/help_whats_this=false actions/help_report_bug=false actions/switch_application_language=false actions/help_about_app=false actions/help_about_kde=false
Definition at line 105 of file khelpmenu.h.
| enum KisKHelpMenu::MenuId |
| Enumerator | |
|---|---|
| menuHelpContents | |
| menuWhatsThis | |
| menuAboutApp | |
| menuAboutKDE | |
| menuReportBug | |
| menuSwitchLanguage | |
Definition at line 160 of file khelpmenu.h.
|
explicit |
Constructor.
| 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 default application dialog box. |
| showWhatsThis | Decides whether a "Whats this" entry will be added to the dialog. |
Definition at line 81 of file khelpmenu.cpp.
References KisKHelpMenuPrivate::createActions(), d, KisKHelpMenuPrivate::mAboutAppText, KisKHelpMenuPrivate::mParent, and KisKHelpMenuPrivate::mShowWhatsThis.
| KisKHelpMenu::KisKHelpMenu | ( | QWidget * | parent, |
| const KAboutData & | aboutData, | ||
| bool | showWhatsThis = true ) |
Constructor.
This alternative constructor is mainly useful if you want to override the standard actions (aboutApplication(), aboutKDE(), helpContents(), reportBug, and optionally whatsThis).
| 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. |
Definition at line 91 of file khelpmenu.cpp.
References KisKHelpMenuPrivate::createActions(), d, KisKHelpMenuPrivate::mAboutData, KisKHelpMenuPrivate::mParent, and KisKHelpMenuPrivate::mShowWhatsThis.
|
override |
Destructor
Destroys dialogs and the menu pointer returned by menu
Definition at line 101 of file khelpmenu.cpp.
References d.
|
slot |
Opens an application specific dialog box.
The method will try to open the about box using the following steps:
Definition at line 216 of file khelpmenu.cpp.
References showAboutApplication().
|
slot |
Opens the standard "About KDE" dialog box.
Definition at line 223 of file khelpmenu.cpp.
References connect(), d, dialogFinished(), KisKHelpMenuPrivate::mAboutKDE, and KisKHelpMenuPrivate::mParent.
| QAction * KisKHelpMenu::action | ( | MenuId | id | ) | const |
Returns the QAction * associated with the given parameter Will return 0 pointers if menu() has not been called
| id | The id of the action of which you want to get QAction * |
Definition at line 180 of file khelpmenu.cpp.
References d, KisKHelpMenuPrivate::mAboutAppAction, KisKHelpMenuPrivate::mAboutKDEAction, menuAboutApp, menuAboutKDE, menuHelpContents, menuReportBug, menuSwitchLanguage, menuWhatsThis, KisKHelpMenuPrivate::mHandBookAction, KisKHelpMenuPrivate::mReportBugAction, KisKHelpMenuPrivate::mSwitchApplicationLanguageAction, and KisKHelpMenuPrivate::mWhatsThisAction.
|
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 211 of file khelpmenu.cpp.
|
slot |
Activates What's This help for the application.
Definition at line 281 of file khelpmenu.cpp.
|
privateslot |
Connected to the dialogs (about kde and bug report) to detect when they are finished.
Definition at line 254 of file khelpmenu.cpp.
References timerExpired().
| QMenu * KisKHelpMenu::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 enough 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 127 of file khelpmenu.cpp.
References connect(), KisKHelpMenuPrivate::createActions(), d, KisKHelpMenuPrivate::mAboutAppAction, KisKHelpMenuPrivate::mAboutKDEAction, menuDestroyed(), KisKHelpMenuPrivate::mHandBookAction, KisKHelpMenuPrivate::mMenu, KisKHelpMenuPrivate::mReportBugAction, KisKHelpMenuPrivate::mSwitchApplicationLanguageAction, and KisKHelpMenuPrivate::mWhatsThisAction.
|
privateslot |
Connected to the menu pointer (if created) to detect a delete operation on the pointer. You should not delete the pointer in your code yourself. Let the KisKHelpMenu destructor do the job.
Definition at line 276 of file khelpmenu.cpp.
References d, and KisKHelpMenuPrivate::mMenu.
|
slot |
Opens the standard "Report Bugs" dialog box.
Definition at line 232 of file khelpmenu.cpp.
References connect(), d, dialogFinished(), KisKHelpMenuPrivate::mAboutData, KisKHelpMenuPrivate::mBugReport, and KisKHelpMenuPrivate::mParent.
|
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.
|
slot |
Opens the changing default application language dialog box.
Definition at line 245 of file khelpmenu.cpp.
References connect(), d, dialogFinished(), KisKHelpMenuPrivate::mParent, and KisKHelpMenuPrivate::mSwitchApplicationLanguage.
|
privateslot |
This slot will delete a dialog (about kde or bug report) if the dialog pointer is not zero and the dialog is not visible. This slot is activated by a one shot timer started in dialogHidden
Definition at line 259 of file khelpmenu.cpp.
References d, KisKHelpMenuPrivate::mAboutApp, KisKHelpMenuPrivate::mAboutKDE, KisKHelpMenuPrivate::mBugReport, and KisKHelpMenuPrivate::mSwitchApplicationLanguage.
|
private |
Definition at line 248 of file khelpmenu.h.