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 } |
This enum indentifies the moving buttons. More... | |
enum | ButtonIconSize { SmallIcon, Small, Medium, Large, XLarge } |
This enum identifies the icon sizes, used for the move buttons. More... | |
enum | InsertionPolicy { BelowCurrent, Sorted, AtTop, AtBottom } |
This enum defines policies for where to insert moved items in a listbox. More... | |
Public Slots | |
void | polish () |
Reimplemented for internal reasons. | |
Signals | |
void | added (QListBoxItem *item) |
Emitted when an item is moved to the "selected" listbox. | |
void | removed (QListBoxItem *item) |
Emitted when an item is moved out of the "selected" listbox. | |
void | movedUp (QListBoxItem *item) |
Emitted when an item is moved upwards in the "selected" listbox. | |
void | movedDown (QListBoxItem *item) |
Emitted when an item is moved downwards in the "selected" listbox. | |
Public Member Functions | |
KActionSelector (QWidget *parent=0, const char *name=0) | |
~KActionSelector () | |
QListBox * | availableListBox () |
QListBox * | selectedListBox () |
bool | moveOnDoubleClick () const |
void | setMoveOnDoubleClick (bool enable) |
Sets moveOnDoubleClick to enable . | |
bool | keyboardEnabled () const |
void | setKeyboardEnabled (bool enable) |
Sets the keyboard enabled depending on enable . | |
QString | availableLabel () const |
void | setAvailableLabel (const QString &text) |
Sets the label for the available items listbox to text . | |
QString | selectedLabel () const |
void | setSelectedLabel (const QString &text) |
Sets the label for the selected items listbox to text . | |
ButtonIconSize | buttonIconSize () const |
void | setButtonIconSize (ButtonIconSize size) |
Sets the button icon size. | |
InsertionPolicy | availableInsertionPolicy () |
void | setAvailableInsertionPolicy (InsertionPolicy policy) |
Sets the insertion policy for the available listbox. | |
InsertionPolicy | selectedInsertionPolicy () |
void | setSelectedInsertionPolicy (InsertionPolicy policy) |
Sets the insertion policy for the selected listbox. | |
bool | showUpDownButtons () |
void | setShowUpDownButtons (bool show) |
Sets wheather the Up and Down buttons should be displayed according to show . | |
void | setButtonIcon (const QString &icon, MoveButton button) |
Sets the pixmap of the button button to icon . | |
void | setButtonIconSet (const QIconSet &iconset, MoveButton button) |
Sets the iconset for button button to iconset . | |
void | setButtonTooltip (const QString &tip, MoveButton button) |
Sets the tooltip for the button button to tip . | |
void | setButtonWhatsThis (const QString &text, MoveButton button) |
Sets the whatsthis help for button button to text . | |
void | setButtonsEnabled () |
Sets the enabled state of all moving buttons to reflect the current options. | |
Protected Member Functions | |
void | keyPressEvent (QKeyEvent *) |
Reimplamented for internal reasons. | |
bool | eventFilter (QObject *, QEvent *) |
Reimplemented for internal reasons. | |
Properties | |
bool | moveOnDoubleClick |
bool | keyboardEnabled |
QString | availableLabel |
QString | selectedLabel |
ButtonIconSize | buttonIconSize |
InsertionPolicy | availableInsertionPolicy |
InsertionPolicy | selectedInsertionPolicy |
bool | showUpDownButtons |
Private Slots | |
void | buttonAddClicked () |
Move selected item from available box to the selected box. | |
void | buttonRemoveClicked () |
Move selected item from selected box to available box. | |
void | buttonUpClicked () |
Move selected item in selected box upwards. | |
void | buttonDownClicked () |
Move seleted item in selected box downwards. | |
void | itemDoubleClicked (QListBoxItem *item) |
Moves the item item to the other listbox if moveOnDoubleClick is enabled. | |
void | slotCurrentChanged (QListBoxItem *) |
connected to both list boxes to set the buttons enabled | |
Private Member Functions | |
void | moveItem (QListBoxItem *item) |
Move item item to the other listbox. | |
void | loadIcons () |
loads the icons for the move buttons. | |
int | insertionIndex (QListBox *lb, InsertionPolicy policy) |
Private Attributes | |
KActionSelectorPrivate * | d |
Private data storage. |
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 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. |
|
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 moveItem(). |
|
This enum indentifies the moving buttons.
Definition at line 105 of file kactionselector.h. |
Constructor & Destructor Documentation
|
|
Definition at line 118 of file kactionselector.cpp. |
Member Function Documentation
|
Emitted when an item is moved to the "selected" listbox.
Referenced by buttonAddClicked(), and moveItem(). |
|
|
|
|
|
Definition at line 126 of file kactionselector.cpp. References KActionSelectorPrivate::availableListBox, and d. Referenced by KFSConfigPage::init(). |
|
Move selected item from available box to the selected box.
Definition at line 414 of file kactionselector.cpp. References added(), KActionSelectorPrivate::availableListBox, d, insertionIndex(), KActionSelectorPrivate::selectedInsertionPolicy, KActionSelectorPrivate::selectedListBox, and Sorted. Referenced by eventFilter(), KActionSelector(), and keyPressEvent(). |
|
Move seleted item in selected box downwards.
Definition at line 461 of file kactionselector.cpp. References d, movedDown(), and KActionSelectorPrivate::selectedListBox. Referenced by eventFilter(), KActionSelector(), and keyPressEvent(). |
|
|
|
Move selected item from selected box to available box.
Definition at line 432 of file kactionselector.cpp. References KActionSelectorPrivate::availableInsertionPolicy, KActionSelectorPrivate::availableListBox, d, insertionIndex(), removed(), KActionSelectorPrivate::selectedListBox, and Sorted. Referenced by eventFilter(), KActionSelector(), and keyPressEvent(). |
|
Move selected item in selected box upwards.
Definition at line 450 of file kactionselector.cpp. References d, movedUp(), and KActionSelectorPrivate::selectedListBox. Referenced by eventFilter(), KActionSelector(), and keyPressEvent(). |
|
Reimplemented for internal reasons.
Definition at line 367 of file kactionselector.cpp. References buttonAddClicked(), buttonDownClicked(), buttonRemoveClicked(), buttonUpClicked(), d, eventFilter(), KActionSelectorPrivate::keyboardEnabled, and moveItem(). Referenced by eventFilter(). |
|
Definition at line 517 of file kactionselector.cpp. References AtTop, BelowCurrent, and insertionIndex(). Referenced by buttonAddClicked(), buttonRemoveClicked(), insertionIndex(), and moveItem(). |
|
Moves the item
Definition at line 472 of file kactionselector.cpp. References d, itemDoubleClicked(), moveItem(), and KActionSelectorPrivate::moveOnDoubleClick. Referenced by itemDoubleClicked(), and KActionSelector(). |
|
The keyboard actions are enabled by default.
|
|
Reimplamented for internal reasons.
Definition at line 341 of file kactionselector.cpp. References buttonAddClicked(), buttonDownClicked(), buttonRemoveClicked(), buttonUpClicked(), d, KActionSelectorPrivate::keyboardEnabled, and keyPressEvent(). Referenced by keyPressEvent(). |
|
loads the icons for the move buttons.
Definition at line 482 of file kactionselector.cpp. References KActionSelectorPrivate::addIcon, KActionSelectorPrivate::btnAdd, KActionSelectorPrivate::btnDown, KActionSelectorPrivate::btnRemove, KActionSelectorPrivate::btnUp, d, KActionSelectorPrivate::downIcon, KActionSelectorPrivate::iconSize, KActionSelectorPrivate::removeIcon, and KActionSelectorPrivate::upIcon. Referenced by KActionSelector(), and setButtonIconSize(). |
|
Emitted when an item is moved downwards in the "selected" listbox.
Referenced by buttonDownClicked(). |
|
Emitted when an item is moved upwards in the "selected" listbox.
Referenced by buttonUpClicked(). |
|
Move item
Definition at line 490 of file kactionselector.cpp. References added(), KActionSelectorPrivate::availableInsertionPolicy, KActionSelectorPrivate::availableListBox, d, insertionIndex(), InsertionPolicy, moveItem(), removed(), KActionSelectorPrivate::selectedInsertionPolicy, KActionSelectorPrivate::selectedListBox, and Sorted. Referenced by eventFilter(), itemDoubleClicked(), and moveItem(). |
|
|
|
Reimplemented for internal reasons. (calls setButtonsEnabled()) Definition at line 333 of file kactionselector.cpp. References setButtonsEnabled(). |
|
Emitted when an item is moved out of the "selected" listbox.
Referenced by buttonRemoveClicked(), and moveItem(). |
|
|
|
|
|
Definition at line 131 of file kactionselector.cpp. References d, and KActionSelectorPrivate::selectedListBox. Referenced by KFSConfigPage::apply(), and KFSConfigPage::init(). |
|
Sets the insertion policy for the available listbox. See also InsertionPolicy, availableInsertionPolicy(). Definition at line 294 of file kactionselector.cpp. References KActionSelectorPrivate::availableInsertionPolicy, d, and setAvailableInsertionPolicy(). Referenced by setAvailableInsertionPolicy(). |
|
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 262 of file kactionselector.cpp. References d, KActionSelectorPrivate::lAvailable, setAvailableLabel(), and text(). Referenced by KFSConfigPage::KFSConfigPage(), and setAvailableLabel(). |
|
Sets the pixmap of the button It calls SmallIconSet(pm) to generate the icon set. Definition at line 136 of file kactionselector.cpp. References KActionSelectorPrivate::addIcon, KActionSelectorPrivate::btnAdd, KActionSelectorPrivate::btnDown, KActionSelectorPrivate::btnRemove, KActionSelectorPrivate::btnUp, ButtonAdd, ButtonDown, ButtonRemove, ButtonUp, d, KActionSelectorPrivate::downIcon, endl(), KActionSelectorPrivate::iconSize, kdDebug(), KActionSelectorPrivate::removeIcon, setButtonIcon(), and KActionSelectorPrivate::upIcon. Referenced by setButtonIcon(). |
|
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 161 of file kactionselector.cpp. References KActionSelectorPrivate::btnAdd, KActionSelectorPrivate::btnDown, KActionSelectorPrivate::btnRemove, KActionSelectorPrivate::btnUp, ButtonAdd, ButtonDown, ButtonRemove, ButtonUp, d, endl(), kdDebug(), and setButtonIconSet(). Referenced by setButtonIconSet(). |
|
Sets the button icon size. See ButtonIconSize for the possible values and their pixel meaning. Definition at line 282 of file kactionselector.cpp. References d, KActionSelectorPrivate::iconSize, loadIcons(), setButtonIconSize(), and size. Referenced by setButtonIconSize(). |
|
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 224 of file kactionselector.cpp. References KActionSelectorPrivate::availableListBox, KActionSelectorPrivate::btnAdd, KActionSelectorPrivate::btnDown, KActionSelectorPrivate::btnRemove, KActionSelectorPrivate::btnUp, d, and KActionSelectorPrivate::selectedListBox. Referenced by polish(), and slotCurrentChanged(). |
|
Sets the tooltip for the button
Definition at line 182 of file kactionselector.cpp. References KActionSelectorPrivate::btnAdd, KActionSelectorPrivate::btnDown, KActionSelectorPrivate::btnRemove, KActionSelectorPrivate::btnUp, ButtonAdd, ButtonDown, ButtonRemove, ButtonUp, d, endl(), kdDebug(), and setButtonTooltip(). Referenced by setButtonTooltip(). |
|
Sets the whatsthis help for button
Definition at line 203 of file kactionselector.cpp. References KActionSelectorPrivate::btnAdd, KActionSelectorPrivate::btnDown, KActionSelectorPrivate::btnRemove, KActionSelectorPrivate::btnUp, ButtonAdd, ButtonDown, ButtonRemove, ButtonUp, d, endl(), kdDebug(), setButtonWhatsThis(), and text(). Referenced by setButtonWhatsThis(). |
|
Sets the keyboard enabled depending on
Definition at line 252 of file kactionselector.cpp. References d, KActionSelectorPrivate::keyboardEnabled, and setKeyboardEnabled(). Referenced by setKeyboardEnabled(). |
|
Sets moveOnDoubleClick to
Definition at line 242 of file kactionselector.cpp. References d, KActionSelectorPrivate::moveOnDoubleClick, and setMoveOnDoubleClick(). Referenced by setMoveOnDoubleClick(). |
|
Sets the insertion policy for the selected listbox. See also InsertionPolicy, selectedInsertionPolicy(). Definition at line 304 of file kactionselector.cpp. References d, KActionSelectorPrivate::selectedInsertionPolicy, and setSelectedInsertionPolicy(). Referenced by setSelectedInsertionPolicy(). |
|
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 272 of file kactionselector.cpp. References d, KActionSelectorPrivate::lSelected, setSelectedLabel(), and text(). Referenced by KFSConfigPage::KFSConfigPage(), and setSelectedLabel(). |
|
Sets wheather the Up and Down buttons should be displayed according to
Definition at line 314 of file kactionselector.cpp. References KActionSelectorPrivate::btnDown, KActionSelectorPrivate::btnUp, d, setShowUpDownButtons(), and KActionSelectorPrivate::showUpDownButtons. Referenced by setShowUpDownButtons(). |
|
|
|
connected to both list boxes to set the buttons enabled
Definition at line 370 of file kactionselector.h. References setButtonsEnabled(). Referenced by KActionSelector(). |
Member Data Documentation
|
Property Documentation
|
Definition at line 84 of file kactionselector.h. |
|
Definition at line 81 of file kactionselector.h. |
|
Definition at line 83 of file kactionselector.h. |
|
Definition at line 80 of file kactionselector.h. |
|
Definition at line 79 of file kactionselector.h. |
|
Definition at line 85 of file kactionselector.h. |
|
Definition at line 82 of file kactionselector.h. |
|
Definition at line 86 of file kactionselector.h. |
The documentation for this class was generated from the following files:
- parts/fileselector/kactionselector.h
- parts/fileselector/kactionselector.cpp