KToolBarPopupAction

KDE 4.9 PyKDE API Reference

- KDE's Python API

# KToolBarPopupAction Class Reference

`from PyKDE4.kdeui import *`

Inherits: KAction → QWidgetAction → QAction → QObject

## Detailed Description

This action is a normal action everywhere, except in a toolbar where it also has a popupmenu (optionally delayed). This action is designed for history actions (back/forward, undo/redo) and for any other action that has more detail in a toolbar than in a menu (e.g. tool chooser with "Other" leading to a dialog...).

In contrast to KActionMenu, this action is a simple menuitem when plugged into a menu, and has a popup only in a toolbar.

Use cases include Back/Forward, and Undo/Redo. Simple click is what's most commonly used, and enough for menus, but in toolbars there is also an optional popup to go back N steps or undo N steps.

## Methods
| __init__ (self, KIcon icon, QString text, QObject parent)
QWidget | createWidget (self, QWidget parent)
bool | delayed (self)
KMenu | popupMenu (self)
| setDelayed (self, bool delayed)
| setStickyMenu (self, bool sticky)
bool | stickyMenu (self)

## Method Documentation

__init__ | ( | self, |
|  | KIcon | icon,
|  | QString | text,
|  | QObject | parent
| ) |  |  |

Create a KToolBarPopupAction, with a text, an icon, a parent and a name.

Parameters:

  | icon | The icon to display.
  | text | The text that will be displayed.
  | parent | This action's parent.

QWidget createWidget | ( | self, |
|  | QWidget | parent
| ) |  |  |

Reimplemented from

See also:
  QActionWidgetFactory.

bool delayed | ( |  | self ) |

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

KMenu popupMenu | ( |  | self ) |

The popup menu that is shown when clicking (some time) on the toolbar button. You may want to plug items into it on creation, or connect to aboutToShow for a more dynamic menu.

Deprecated:
  use menu() instead

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.

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. Only available if delayed() is true. Default: sticky.

bool stickyMenu | ( |  | self ) |

Returns true if this action creates a sticky popup menu.

See also:
  setStickyMenu().