MutuallyExclusiveListWidget Class Reference

A widget that allow users to select an ordered set of items from a master list. More...

#include <MutuallyExclusiveListWidget.h>

List of all members.

Public Slots

void selectItems (const QStringList &items)
void removeItems (const QStringList &items)

Signals

void itemSelected (const QString &item)
void itemRemoved (const QString &item)

Public Member Functions

 MutuallyExclusiveListWidget (QWidget *pParent=NULL)
virtual ~MutuallyExclusiveListWidget ()
void setAvailableItemsLabel (const QString &label)
QString getAvailableItemsLabel () const
void setAvailableItems (const QStringList &items)
QStringList getAvailableItems () const
void setSelectedItemsLabel (const QString &label)
QString getSelectedItemsLabel () const
QStringList getSelectedItems () const

Protected Slots

void addSelectedItem ()
void removeSelectedItem ()


Detailed Description

A widget that allow users to select an ordered set of items from a master list.

The mutually exclusive list widget contains two QListWidget objects: one list to contain available items to select, and another list to contain the ordered set of items selected from the first list. When an item is selected from the available items list it is added to the selected items list and no longer appears in the available items list. Both list widgets are single selection and cannot be sorted.

The widget also contains Add and Remove buttons to transfer items between the two lists, and labels to provide a description of each list.

Definition at line 33 of file MutuallyExclusiveListWidget.h.


Constructor & Destructor Documentation

MutuallyExclusiveListWidget::MutuallyExclusiveListWidget ( QWidget *  pParent = NULL  ) 

Creates a new mutually exclusive list widget with empty lists and default labels of "Available Items" and "Selected Items".

Parameters:
pParent The parent widget.

virtual MutuallyExclusiveListWidget::~MutuallyExclusiveListWidget (  )  [virtual]

Destroys the mutually exclusive list widget.


Member Function Documentation

void MutuallyExclusiveListWidget::setAvailableItemsLabel ( const QString &  label  ) 

Sets the text description of the available items list.

Parameters:
label The available items list description.
See also:
setSelectedItemsLabel()

QString MutuallyExclusiveListWidget::getAvailableItemsLabel (  )  const

Returns the text description of the available items list.

Returns:
The available items list description.
See also:
getSelectedItemsLabel()

void MutuallyExclusiveListWidget::setAvailableItems ( const QStringList &  items  ) 

Sets the list of available items to select from.

This methods clears the existing contents of both the available items and selected items lists. The method then populates the available items list with the given names. To set initially selected items call selectItems() after calling this method.

Parameters:
items The list of available items.

QStringList MutuallyExclusiveListWidget::getAvailableItems (  )  const

Returns the list of remaining available items to select from.

This methods returns only the items in the available items list that have not been selected.

Returns:
The list of remaining available items.
See also:
getSelectedItems()

void MutuallyExclusiveListWidget::setSelectedItemsLabel ( const QString &  label  ) 

Sets the text description of the selected items list.

Parameters:
label The selected items list description.
See also:
setAvailableItemsLabel()

QString MutuallyExclusiveListWidget::getSelectedItemsLabel (  )  const

Returns the text description of the selected items list.

Returns:
The selected items list description.
See also:
getAvailableItemsLabel()

QStringList MutuallyExclusiveListWidget::getSelectedItems (  )  const

Returns the list of selected items.

Returns:
The list of selected items.
See also:
getAvailableItems()

void MutuallyExclusiveListWidget::selectItems ( const QStringList &  items  )  [slot]

Moves items from the available items list to the selected items list.

Parameters:
items The items to move from the available items list to the selected items list.
See also:
removeItems()

void MutuallyExclusiveListWidget::removeItems ( const QStringList &  items  )  [slot]

Moves items from the selected items list to the available items list.

Parameters:
items The items to move from the selected items list to the available items list.
See also:
selectItems()

void MutuallyExclusiveListWidget::itemSelected ( const QString &  item  )  [signal]

A signal that is emitted when an item moves from the available items list to the selected items list.

The signal is emitted when the user clicks the Add button or when the selectItems() method is called. If multiple items are moved as a result of calling selectItems(), the signal is emitted once for each item.

Parameters:
item The item that moved from the available items list to the selected items list.

void MutuallyExclusiveListWidget::itemRemoved ( const QString &  item  )  [signal]

A signal that is emitted when an item moves from the selected items list to the available items list.

The signal is emitted when the user clicks the Remove button or when the removeItems() method is called. If multiple items are moved as a result of calling removeItems(), the signal is emitted once for each item.

Parameters:
item The item that moved from the selected items list to the available items list.

void MutuallyExclusiveListWidget::addSelectedItem (  )  [protected, slot]

Moves the currently selected item in the available items list to the selected items list.

This method is called automatically when the user clicks the Add button, and should not need to be called explicitly.

void MutuallyExclusiveListWidget::removeSelectedItem (  )  [protected, slot]

Moves the currently selected item in the selected items list to the available items list.

This method is called automatically when the user clicks the Remove button, and should not need to be called explicitly.


Software Development Kit - Opticks 4.9.0 Build 16218