KActionSelector Class Reference
A widget for selecting and arranging actions/objects This widget allows the user to select from a set of objects and arrange the order of the selected ones using two list boxes labeled "Available" and "Used" with horizontal arrows in between to move selected objects between the two, and vertical arrows on the right to arrange the order of the selected objects. More...
#include <kactionselector.h>
Inheritance diagram for KActionSelector:

Public Types | |
enum | MoveButton { ButtonAdd, ButtonRemove, ButtonUp, ButtonDown } |
enum | ButtonIconSize { SmallIcon, Small, Medium, Large, XLarge } |
enum | InsertionPolicy { BelowCurrent, Sorted, AtTop, AtBottom } |
Public Slots | |
void | polish () |
Signals | |
void | added (QListBoxItem *item) |
void | removed (QListBoxItem *item) |
void | movedUp (QListBoxItem *item) |
void | movedDown (QListBoxItem *item) |
Public Member Functions | |
KActionSelector (QWidget *parent=0, const char *name=0) | |
QListBox * | availableListBox () const |
QListBox * | selectedListBox () const |
bool | moveOnDoubleClick () const |
void | setMoveOnDoubleClick (bool enable) |
bool | keyboardEnabled () const |
void | setKeyboardEnabled (bool enable) |
QString | availableLabel () const |
void | setAvailableLabel (const QString &text) |
QString | selectedLabel () const |
void | setSelectedLabel (const QString &text) |
ButtonIconSize | buttonIconSize () const |
void | setButtonIconSize (ButtonIconSize size) |
InsertionPolicy | availableInsertionPolicy () const |
void | setAvailableInsertionPolicy (InsertionPolicy policy) |
InsertionPolicy | selectedInsertionPolicy () const |
void | setSelectedInsertionPolicy (InsertionPolicy policy) |
bool | showUpDownButtons () const |
void | setShowUpDownButtons (bool show) |
void | setButtonIcon (const QString &icon, MoveButton button) |
void | setButtonIconSet (const QIconSet &iconset, MoveButton button) |
void | setButtonTooltip (const QString &tip, MoveButton button) |
void | setButtonWhatsThis (const QString &text, MoveButton button) |
void | setButtonsEnabled () |
Protected Member Functions | |
void | keyPressEvent (QKeyEvent *) |
bool | eventFilter (QObject *, QEvent *) |
Detailed Description
A widget for selecting and arranging actions/objects This widget allows the user to select from a set of objects and arrange the order of the selected ones using two list boxes labeled "Available" and "Used" with horizontal arrows in between to move selected objects between the two, and vertical arrows on the right to arrange the order of the selected objects.The widget moves objects to the other listbox when doubleclicked if the property moveOnDoubleClick is set to true (default). See moveOnDoubleClick() and setMoveOnDoubleClick().
The user control the widget using the keyboard if enabled (default), see keyboardEnabled.
Note that this may conflist with keyboard selection in the selected list box, if you set that to anything else than QListBox::Single (which is the default).
To use it, simply construct an instance and then add items to the two listboxes, available through lbAvailable() and lbSelected(). Whenever you want, you can retrieve the selected options using QListBox methods on lbSelected().
This way, you can use your own QListBoxItem class, allowing you to easily store object data in those.
When an item is moved to a listbox, it is placed below the current item of that listbox.
Standard arrow icons are used, but you can use icons of your own choice if desired, see setButtonIcon(). It is also possible to set tooltips and whatsthis help for the buttons. See setButtonTooltip() and setButtonWhatsThis().
To set whatsthis or tooltips for the listboxes, access them through availableListbox() and selectedListBox().
All the moving buttons are automatically set enabled as expected.
Signals are sent each time an item is moved, allowing you to follow the users actions if you need to. See addedToSelection(), removedFromSelection(), movedUp() and movedDown()
- Author:
- Anders Lund <anders@alweb.dk>
Definition at line 76 of file kactionselector.h.
Member Enumeration Documentation
|
This enum indentifies the moving buttons.
Definition at line 105 of file kactionselector.h. |
|
This enum identifies the icon sizes, used for the move buttons. The values correspond to the following pixel sizes:
Definition at line 122 of file kactionselector.h. Referenced by buttonIconSize(). |
|
This enum defines policies for where to insert moved items in a listbox. The following policies are currently defined:
Definition at line 142 of file kactionselector.h. Referenced by availableInsertionPolicy(), and selectedInsertionPolicy(). |
Member Function Documentation
|
Definition at line 127 of file kactionselector.cpp. |
|
Definition at line 132 of file kactionselector.cpp. |
|
Definition at line 238 of file kactionselector.cpp. |
|
Sets moveOnDoubleClick to
Definition at line 243 of file kactionselector.cpp. |
|
The keyboard actions are enabled by default.
Definition at line 248 of file kactionselector.cpp. |
|
Sets the keyboard enabled depending on
Definition at line 253 of file kactionselector.cpp. |
|
Definition at line 258 of file kactionselector.cpp. |
|
Sets the label for the available items listbox to Note that this label has the listbox as its buddy, so that if you have a single ampersand in the text, the following character will become the accellerator to focus te listbox. Definition at line 263 of file kactionselector.cpp. |
|
Definition at line 268 of file kactionselector.cpp. |
|
Sets the label for the selected items listbox to Note that this label has the listbox as its buddy, so that if you have a single ampersand in the text, the following character will become the accellerator to focus te listbox. Definition at line 273 of file kactionselector.cpp. |
|
Definition at line 278 of file kactionselector.cpp. References ButtonIconSize. |
|
Sets the button icon size. See ButtonIconSize for the possible values and their pixel meaning. Definition at line 283 of file kactionselector.cpp. |
|
Definition at line 290 of file kactionselector.cpp. References InsertionPolicy. |
|
Sets the insertion policy for the available listbox. See also InsertionPolicy, availableInsertionPolicy(). Definition at line 295 of file kactionselector.cpp. |
|
Definition at line 300 of file kactionselector.cpp. References InsertionPolicy. |
|
Sets the insertion policy for the selected listbox. See also InsertionPolicy, selectedInsertionPolicy(). Definition at line 305 of file kactionselector.cpp. |
|
Definition at line 310 of file kactionselector.cpp. |
|
Sets wheather the Up and Down buttons should be displayed according to
Definition at line 315 of file kactionselector.cpp. |
|
Sets the pixmap of the button It calls SmallIconSet(pm) to generate the icon set. Definition at line 137 of file kactionselector.cpp. References kdDebug(). |
|
Sets the iconset for button You can use this method to et a costum icon set. Either created by QIconSet, or use the application instance of KIconLoader (recommended). Definition at line 162 of file kactionselector.cpp. References kdDebug(). |
|
Sets the tooltip for the button
Definition at line 183 of file kactionselector.cpp. References kdDebug(). |
|
Sets the whatsthis help for button
Definition at line 204 of file kactionselector.cpp. References kdDebug(). |
|
Sets the enabled state of all moving buttons to reflect the current options. Be sure to call this if you add or removes items to either listbox after the widget is show()n Definition at line 225 of file kactionselector.cpp. Referenced by polish(). |
|
Emitted when an item is moved to the "selected" listbox.
|
|
Emitted when an item is moved out of the "selected" listbox.
|
|
Emitted when an item is moved upwards in the "selected" listbox.
|
|
Emitted when an item is moved downwards in the "selected" listbox.
|
|
Reimplemented for internal reasons. (calls setButtonsEnabled()) Definition at line 334 of file kactionselector.cpp. References setButtonsEnabled(). |
|
Reimplamented for internal reasons.
Definition at line 342 of file kactionselector.cpp. |
|
Reimplemented for internal reasons.
Definition at line 368 of file kactionselector.cpp. |
The documentation for this class was generated from the following files: