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

KDE3Support

K3PopupMenu Class Reference

A menu with keyboard searching and convenience methods for title items. More...

#include <k3popupmenu.h>

Inheritance diagram for K3PopupMenu:
Q3PopupMenu

List of all members.

Signals

void aboutToShowContextMenu (K3PopupMenu *menu, int menuItem, Q3PopupMenu *ctxMenu)
void aboutToShowContextMenu (K3PopupMenu *menu, QAction *menuAction, QMenu *ctxMenu)

Public Member Functions

QAction * addTitle (const QIcon &icon, const QString &text, QAction *before=0L)
QAction * addTitle (const QString &text, QAction *before=0L)
const Q3PopupMenu * contextMenu () const
Q3PopupMenu * contextMenu ()
void hideContextMenu ()
 K3PopupMenu (QWidget *parent=0)
Qt::KeyboardModifiers keyboardModifiers () const
Qt::MouseButtons mouseButtons () const
void setKeyboardShortcutsEnabled (bool enable)
void setKeyboardShortcutsExecute (bool enable)
 ~K3PopupMenu ()

Static Public Member Functions

static K3PopupMenu * contextMenuFocus ()
static QAction * contextMenuFocusAction ()

Protected Slots

void actionHovered (QAction *action)
void ctxMenuHideShowingMenu ()
void ctxMenuHiding ()
void resetKeyboardVars (bool noMatches=false)
void showCtxMenu (const QPoint &pos)
QString underlineText (const QString &text, uint length)

Protected Member Functions

virtual void closeEvent (QCloseEvent *)
virtual void contextMenuEvent (QContextMenuEvent *e)
virtual bool focusNextPrevChild (bool next)
virtual void hideEvent (QHideEvent *)
virtual void keyPressEvent (QKeyEvent *e)
virtual void mousePressEvent (QMouseEvent *e)
virtual void mouseReleaseEvent (QMouseEvent *e)
virtual void virtual_hook (int id, void *data)

Detailed Description

A menu with keyboard searching and convenience methods for title items.

K3PopupMenu is a compatibility class for KPopupMenu from KDE 3. It provides menus with standard title items and keyboard accessibility for popups with many options and/or varying options. It acts identically to QMenu, with the addition of insertTitle(), changeTitle(), setKeyboardShortcutsEnabled() and setKeyboardShortcutsExecute() methods.

The titles support a text string and an icon.

The keyboard search algorithm is incremental with additional underlining for user feedback.

Author:
Daniel M. Duley <mosfet@kde.org>
Hamish Rodda <rodda@kde.org>

Definition at line 49 of file k3popupmenu.h.


Constructor & Destructor Documentation

K3PopupMenu::K3PopupMenu ( QWidget *  parent = 0  ) 

Constructs a K3PopupMenu.

Definition at line 88 of file k3popupmenu.cpp.

K3PopupMenu::~K3PopupMenu (  ) 

Destructs the object.

Definition at line 96 of file k3popupmenu.cpp.


Member Function Documentation

void K3PopupMenu::aboutToShowContextMenu ( K3PopupMenu *  menu,
int  menuItem,
Q3PopupMenu *  ctxMenu 
) [signal]

compat

void K3PopupMenu::aboutToShowContextMenu ( K3PopupMenu *  menu,
QAction *  menuAction,
QMenu *  ctxMenu 
) [signal]

connect to this signal to be notified when a context menu is about to be shown

Parameters:
menu The menu that the context menu is about to be shown for
menuAction The action that the context menu is currently on
ctxMenu The context menu itself
void K3PopupMenu::actionHovered ( QAction *  action  )  [protected, slot]

Definition at line 434 of file k3popupmenu.cpp.

QAction * K3PopupMenu::addTitle ( const QIcon &  icon,
const QString &  text,
QAction *  before = 0L 
)

Inserts a title item with the given icon and title.

Definition at line 119 of file k3popupmenu.cpp.

QAction * K3PopupMenu::addTitle ( const QString &  text,
QAction *  before = 0L 
)

Inserts a title item with no icon.

Definition at line 108 of file k3popupmenu.cpp.

void K3PopupMenu::closeEvent ( QCloseEvent *  e  )  [protected, virtual]

This is re-implemented for keyboard navigation.

Definition at line 133 of file k3popupmenu.cpp.

const Q3PopupMenu * K3PopupMenu::contextMenu (  )  const

Returns the context menu associated with this menu.

Definition at line 414 of file k3popupmenu.cpp.

Q3PopupMenu * K3PopupMenu::contextMenu (  ) 

Returns the context menu associated with this menu.

Definition at line 403 of file k3popupmenu.cpp.

void K3PopupMenu::contextMenuEvent ( QContextMenuEvent *  e  )  [protected, virtual]

Definition at line 501 of file k3popupmenu.cpp.

K3PopupMenu * K3PopupMenu::contextMenuFocus (  )  [static]

Returns the K3PopupMenu associated with the current context menu.

Definition at line 429 of file k3popupmenu.cpp.

QAction * K3PopupMenu::contextMenuFocusAction (  )  [static]

returns the QAction associated with the current context menu

Definition at line 424 of file k3popupmenu.cpp.

void K3PopupMenu::ctxMenuHideShowingMenu (  )  [protected, slot]

Definition at line 484 of file k3popupmenu.cpp.

void K3PopupMenu::ctxMenuHiding (  )  [protected, slot]

Definition at line 491 of file k3popupmenu.cpp.

bool K3PopupMenu::focusNextPrevChild ( bool  next  )  [protected, virtual]

Definition at line 330 of file k3popupmenu.cpp.

void K3PopupMenu::hideContextMenu (  ) 

Hides the context menu if shown.

Definition at line 419 of file k3popupmenu.cpp.

void K3PopupMenu::hideEvent ( QHideEvent *  e  )  [protected, virtual]

Definition at line 521 of file k3popupmenu.cpp.

Qt::KeyboardModifiers K3PopupMenu::keyboardModifiers (  )  const

Return the state of the keyboard modifiers when the last menuitem was activated.

Definition at line 162 of file k3popupmenu.cpp.

void K3PopupMenu::keyPressEvent ( QKeyEvent *  e  )  [protected, virtual]

Definition at line 167 of file k3popupmenu.cpp.

Qt::MouseButtons K3PopupMenu::mouseButtons (  )  const

Return the state of the mouse buttons when the last menuitem was activated.

Definition at line 157 of file k3popupmenu.cpp.

void K3PopupMenu::mousePressEvent ( QMouseEvent *  e  )  [protected, virtual]

End keyboard navigation.

RMB menus on menus

Definition at line 378 of file k3popupmenu.cpp.

void K3PopupMenu::mouseReleaseEvent ( QMouseEvent *  e  )  [protected, virtual]

Definition at line 389 of file k3popupmenu.cpp.

void K3PopupMenu::resetKeyboardVars ( bool  noMatches = false  )  [protected, slot]

Definition at line 346 of file k3popupmenu.cpp.

void K3PopupMenu::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.

Definition at line 361 of file k3popupmenu.cpp.

void K3PopupMenu::setKeyboardShortcutsExecute ( bool  enable  ) 

Enables execution of the menu item once it is uniquely specified.

Defaults to off.

Definition at line 366 of file k3popupmenu.cpp.

void K3PopupMenu::showCtxMenu ( const QPoint &  pos  )  [protected, slot]

Definition at line 445 of file k3popupmenu.cpp.

QString K3PopupMenu::underlineText ( const QString &  text,
uint  length 
) [protected, slot]

Definition at line 336 of file k3popupmenu.cpp.

void K3PopupMenu::virtual_hook ( int  id,
void *  data 
) [protected, virtual]

end of RMB menus on menus support

Definition at line 543 of file k3popupmenu.cpp.


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

KDE3Support

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

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal