lib
KoSelectAction Class Reference
#include <KoSelectAction.h>
Inheritance diagram for KoSelectAction:

Detailed Description
An action that provides a menu with items that can be selected.The main difference between this action and a KSelectAction is that it is plugged into a toolbar as a dropdown menu and not as a combobox.
Definition at line 31 of file KoSelectAction.h.
Public Slots | |
virtual void | setCurrentSelection (int index) |
Signals | |
void | selectionChanged (int) |
Public Member Functions | |
KoSelectAction (const QString &text, const QString &icon, QObject *parent=0, const char *name=0) | |
KoSelectAction (const QString &text, const QString &icon, const QObject *receiver, const char *slot, QObject *parent, const char *name=0) | |
~KoSelectAction () | |
KPopupMenu * | popupMenu () const |
void | popup (const QPoint &global) |
virtual int | plug (QWidget *widget, int index=-1) |
virtual int | currentSelection () |
void | setShowCurrentSelection (bool show) |
Protected Slots | |
virtual void | execute (int index) |
Constructor & Destructor Documentation
KoSelectAction::KoSelectAction | ( | const QString & | text, | |
const QString & | icon, | |||
QObject * | parent = 0 , |
|||
const char * | name = 0 | |||
) |
Constructs a KoSelectAction with a text and an icon.
- Parameters:
-
text The text that will be displayed. icon The dynamically loaded icon that goes with this action. parent This action's parent. name An internal name for this action.
Definition at line 54 of file KoSelectAction.cpp.
KoSelectAction::KoSelectAction | ( | const QString & | text, | |
const QString & | icon, | |||
const QObject * | receiver, | |||
const char * | slot, | |||
QObject * | parent, | |||
const char * | name = 0 | |||
) |
Same as above, but it also connects a slot to the selectionChanged(int) signal.
- Parameters:
-
text The text that will be displayed. icon The dynamically loaded icon that goes with this action. receiver The SLOT's parent. slot The SLOT to invoke when a selectionChanged(int) signal is emited. parent This action's parent. name An internal name for this action.
Definition at line 63 of file KoSelectAction.cpp.
Member Function Documentation
KPopupMenu * KoSelectAction::popupMenu | ( | ) | const |
void KoSelectAction::popup | ( | const QPoint & | global | ) |
Shows the popup menu.
- Parameters:
-
global Position at which the popup menu is shown.
Definition at line 82 of file KoSelectAction.cpp.
int KoSelectAction::currentSelection | ( | ) | [virtual] |
Returns the index of the currently selected item.
Definition at line 173 of file KoSelectAction.cpp.
void KoSelectAction::setShowCurrentSelection | ( | bool | show | ) |
If the current selection selection should be shown or not in the menu.
Definition at line 188 of file KoSelectAction.cpp.
void KoSelectAction::selectionChanged | ( | int | ) | [signal] |
Emited when the selection changed.
void KoSelectAction::setCurrentSelection | ( | int | index | ) | [virtual, slot] |
Set which item that should be selected.
- Parameters:
-
index Index of item that should be selected
Definition at line 178 of file KoSelectAction.cpp.
void KoSelectAction::execute | ( | int | index | ) | [protected, virtual, slot] |
Execute an item.
By default it sets the item as selected and emits the selectionChanged signal.
- Parameters:
-
index Index of the item that should be executed.
Reimplemented in KoLineWidthAction.
Definition at line 167 of file KoSelectAction.cpp.
The documentation for this class was generated from the following files: