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

KDEUI

KActionMenu Class Reference

A KActionMenu is an action that has several properties specific to holding a sub-menu of other actions. More...

#include <kactionmenu.h>

Inheritance diagram for KActionMenu:
KAction QWidgetAction

List of all members.

Public Member Functions

void addAction (QAction *action)
QAction * addSeparator ()
virtual QWidget * createWidget (QWidget *parent)
bool delayed () const
void insertAction (QAction *before, QAction *action)
QAction * insertSeparator (QAction *before)
 KActionMenu (const KIcon &icon, const QString &text, QObject *parent)
 KActionMenu (const QString &text, QObject *parent)
 KActionMenu (QObject *parent)
KMenu * menu ()
KDE_DEPRECATED KMenu * popupMenu ()
KDE_DEPRECATED void remove (KAction *)
void removeAction (QAction *action)
void setDelayed (bool delayed)
void setMenu (KMenu *menu)
void setStickyMenu (bool sticky)
bool stickyMenu () const
virtual ~KActionMenu ()

Properties

bool delayed
bool stickyMenu

Detailed Description

A KActionMenu is an action that has several properties specific to holding a sub-menu of other actions.

Any QAction can be used to create a submenu.

Plugged in a popupmenu, it will create a submenu. Plugged in a toolbar, it will create a button with a popup menu.

This is the action used by the XMLGUI since it holds other actions. If you want a submenu for selecting one tool among many (without icons), see KSelectAction. See also setDelayed about the main action.

Definition at line 47 of file kactionmenu.h.


Constructor & Destructor Documentation

KActionMenu::KActionMenu ( QObject *  parent  )  [explicit]

Definition at line 52 of file kactionmenu.cpp.

KActionMenu::KActionMenu ( const QString &  text,
QObject *  parent 
)

Definition at line 59 of file kactionmenu.cpp.

KActionMenu::KActionMenu ( const KIcon &  icon,
const QString &  text,
QObject *  parent 
)

Definition at line 67 of file kactionmenu.cpp.

KActionMenu::~KActionMenu (  )  [virtual]

Definition at line 74 of file kactionmenu.cpp.


Member Function Documentation

void KActionMenu::addAction ( QAction *  action  ) 

Definition at line 113 of file kactionmenu.cpp.

QAction * KActionMenu::addSeparator (  ) 

Definition at line 118 of file kactionmenu.cpp.

QWidget * KActionMenu::createWidget ( QWidget *  parent  )  [virtual]

Definition at line 80 of file kactionmenu.cpp.

bool KActionMenu::delayed (  )  const

Returns true if this action creates a delayed popup menu when plugged in a KToolBar.

void KActionMenu::insertAction ( QAction *  before,
QAction *  action 
)

Definition at line 134 of file kactionmenu.cpp.

QAction * KActionMenu::insertSeparator ( QAction *  before  ) 

Definition at line 126 of file kactionmenu.cpp.

KMenu * KActionMenu::menu (  ) 

Returns this action's menu as a KMenu, if it is one.

If none exists, one will be created.

Definition at line 160 of file kactionmenu.cpp.

KDE_DEPRECATED KMenu* KActionMenu::popupMenu (  )  [inline]

Returns this action's menu as a KMenu, if it is one.

If none exists, one will be created.

Deprecated:
use menu() instead.

Definition at line 75 of file kactionmenu.h.

void KActionMenu::remove ( KAction *  cmd  ) 
Deprecated:

Definition at line 107 of file kactionmenu.cpp.

void KActionMenu::removeAction ( QAction *  action  ) 

Definition at line 139 of file kactionmenu.cpp.

void KActionMenu::setDelayed ( bool  delayed  ) 

If set to true, this action will create a delayed popup menu when plugged in a KToolBar.

Otherwise it creates a normal popup. Default: delayed

Remember that if the "main" action (the toolbar button itself) cannot be clicked, then you should call setDelayed(false).

In the other case, if the main action can be clicked, it can only happen in a toolbar: in a menu, the parent of a submenu can't be activated. To get a "normal" menu item when plugged a menu (and no submenu) use KToolBarPopupAction.

Definition at line 148 of file kactionmenu.cpp.

void KActionMenu::setMenu ( KMenu *  menu  ) 

Definition at line 168 of file kactionmenu.cpp.

void KActionMenu::setStickyMenu ( bool  sticky  ) 

If set to true, this action will create a sticky popup menu when plugged in a KToolBar.

"Sticky", means it's visible until a selection is made or the mouse is clicked elsewhere. This feature allows you to make a selection without having to press and hold down the mouse while making a selection. Default: sticky.

Definition at line 156 of file kactionmenu.cpp.

bool KActionMenu::stickyMenu (  )  const

Returns true if this action creates a sticky popup menu.

See also:
setStickyMenu().

Property Documentation

bool KActionMenu::delayed [read, write]

Definition at line 50 of file kactionmenu.h.

bool KActionMenu::stickyMenu [read, write]

Definition at line 51 of file kactionmenu.h.


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

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Modules
  • 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