KDE 5.0 PyKDE API Reference
  • KDE's Python API
  • Overview
  • PyKDE Home
  • Sitemap
  • Contact Us
 

KActionMenu Class Reference

from PyKDE5.kwidgetsaddons import *

Inherits: QWidgetAction → QAction → QObject

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.


Methods

 __init__ (self, QObject parent)
 __init__ (self, QString text, QObject parent)
 __init__ (self, QIcon icon, QString text, QObject parent)
 addAction (self, QAction action)
QAction addSeparator (self)
QWidget createWidget (self, QWidget parent)
bool delayed (self)
 insertAction (self, QAction before, QAction action)
QAction insertSeparator (self, QAction before)
 removeAction (self, QAction action)
 setDelayed (self, bool delayed)
 setStickyMenu (self, bool sticky)
bool stickyMenu (self)

Method Documentation

__init__ (  self,
QObject  parent
)
__init__ (  self,
QString  text,
QObject  parent
)
__init__ (  self,
QIcon  icon,
QString  text,
QObject  parent
)
addAction (  self,
QAction  action
)

Deprecated:

QAction addSeparator (   self )
QWidget createWidget (  self,
QWidget  parent
)
bool delayed (   self )

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

insertAction (  self,
QAction  before,
QAction  action
)
QAction insertSeparator (  self,
QAction  before
)
removeAction (  self,
QAction  action
)
setDelayed (  self,
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.

setStickyMenu (  self,
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.

bool stickyMenu (   self )

Returns true if this action creates a sticky popup menu.

See also:
setStickyMenu().

  • Full Index

Modules

  • karchive
  • kcoreaddons
  • kguiaddons
  • kitemmodels
  • kitemviews
  • kplotting
  • kwidgetsaddons
  • solid
  • sonnet
This documentation is maintained by Simon Edwards.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal