Main Page Modules Namespace List Class Hierarchy Compound List File List Namespace Members Compound Members Related Pages
KPopupMenu Class Reference
A menu with title items.
More...
#include <kpopupmenu.h>
Inheritance diagram for KPopupMenu:
List of all members.
|
Public Methods |
| | KPopupMenu (QWidget *parent=0, const char *name=0) |
| | ~KPopupMenu () |
| int | insertTitle (const QString &text, int id=-1, int index=-1) |
| int | insertTitle (const QPixmap &icon, const QString &text, int id=-1, int index=-1) |
| void | changeTitle (int id, const QString &text) |
| void | changeTitle (int id, const QPixmap &icon, const QString &text) |
| QString | title (int id=-1) const |
| QPixmap | titlePixmap (int id) const |
| void | setKeyboardShortcutsEnabled (bool enable) |
| void | setKeyboardShortcutsExecute (bool enable) |
| | KPopupMenu (const QString &title, QWidget *parent=0, const char *name=0) |
| void | setTitle (const QString &title) |
Protected Slots |
|
QString | underlineText (const QString &text, uint length) |
| | - Since:
-
3.1
|
|
void | resetKeyboardVars (bool noMatches=false) |
| | - Since:
-
3.1
|
Detailed Description
A menu with title items.
KPopupMenu is a class for menus with standard title items and keyboard accessibility for popups with many options and/or varying options. It acts identically to QPopupMenu, with the addition of insertTitle(), changeTitle(), setKeyboardShortcutsEnabled() and setKeyboardShortcutsExecute() methods.
The titles support a text string, an icon, plus user defined gradients, colors, and background pixmaps.
The keyboard search algorithm is incremental with additional underlining for user feedback.
- Author:
-
Daniel M. Duley <mosfet@kde.org> , Hamish Rodda <meddie@yoyo.its.monash.edu.au>
Definition at line 116 of file kpopupmenu.h.
Constructor & Destructor Documentation
| KPopupMenu::KPopupMenu |
( |
QWidget * |
parent = 0, |
|
|
const char * |
name = 0 |
|
) |
|
|
| KPopupMenu::~KPopupMenu |
( |
|
) |
|
|
| KPopupMenu::KPopupMenu |
( |
const QString & |
title, |
|
|
QWidget * |
parent = 0, |
|
|
const char * |
name = 0 |
|
) |
|
|
|
|
Obsolete method provided for backwards compatibility only. Use the normal constructor and insertTitle instead. |
Member Function Documentation
| void KPopupMenu::changeTitle |
( |
int |
id, |
|
|
const QPixmap & |
icon, |
|
|
const QString & |
text |
|
) |
|
|
|
|
Changes the title and icon of the title item at the specified id. |
| void KPopupMenu::changeTitle |
( |
int |
id, |
|
|
const QString & |
text |
|
) |
|
|
|
|
Changes the title of the item at the specified id. If a icon was previously set it is cleared. |
| int KPopupMenu::insertTitle |
( |
const QPixmap & |
icon, |
|
|
const QString & |
text, |
|
|
int |
id = -1, |
|
|
int |
index = -1 |
|
) |
|
|
|
|
Inserts a title item with the given icon and title. |
| int KPopupMenu::insertTitle |
( |
const QString & |
text, |
|
|
int |
id = -1, |
|
|
int |
index = -1 |
|
) |
|
|
|
|
Inserts a title item with no icon. |
| void KPopupMenu::setKeyboardShortcutsEnabled |
( |
bool |
enable |
) |
|
|
|
|
Enables keyboard navigation by searching for the entered key sequence. Also underlines the currently selected item, providing feedback on the search.
Defaults to off.
WARNING: calls to text() of currently keyboard-selected items will contain additional ampersand characters.
WARNING: though pre-existing keyboard shortcuts will not interfere with the operation of this feature, they may be confusing to the user as the existing shortcuts will not work. - Since:
-
3.1
|
| void KPopupMenu::setKeyboardShortcutsExecute |
( |
bool |
enable |
) |
|
|
|
|
Enables execution of the menu item once it is uniquely specified. Defaults to off. - Since:
-
3.1
|
| void KPopupMenu::setTitle |
( |
const QString & |
title |
) |
|
|
|
|
Obsolete method provided for backwards compatibility only. Use insertTitle and changeTitle instead. |
| QString KPopupMenu::title |
( |
int |
id = -1 |
) |
const |
|
|
|
Returns the title of the title item at the specified id. The default id of -1 is for backwards compatibility only, you should always specify the id. |
| QPixmap KPopupMenu::titlePixmap |
( |
int |
id |
) |
const |
|
|
|
Returns the icon of the title item at the specified id. |
The documentation for this class was generated from the following file:
Generated on Wed Aug 13 23:30:20 2003 for kdelibs by
1.2.18