OSB_GUI::ValueCombo< Value > Class Template Reference

Inheritance diagram for OSB_GUI::ValueCombo< Value >:

Inheritance graph
[legend]
Collaboration diagram for OSB_GUI::ValueCombo< Value >:

Collaboration graph
[legend]
List of all members.

Detailed Description

template<typename Value>
class OSB_GUI::ValueCombo< Value >

Template for combo boxes.

It provides the mapping between the current item of the combobox and Value.

Parameters:
Value This is the value that is mapped against the index.

Definition at line 120 of file osbcombos.h.

Public Member Functions

Protected Member Functions

Private Types

Private Attributes


Member Typedef Documentation

template<typename Value>
typedef ValueMap::size_type OSB_GUI::ValueCombo< Value >::Size [private]

Short-hand for the size-type of the value map.

Definition at line 208 of file osbcombos.h.

template<typename Value>
typedef std::vector<Value> OSB_GUI::ValueCombo< Value >::ValueMap [private]

Container for mapping of index versus value.

Definition at line 206 of file osbcombos.h.


Constructor & Destructor Documentation

template<typename Value>
OSB_GUI::ValueCombo< Value >::ValueCombo ( QWidget parent,
const char *  name 
)

Constructor with Qt arguments.

Definition at line 269 of file osbcombos.h.

template<typename Value>
OSB_GUI::ValueCombo< Value >::~ValueCombo (  )  [pure virtual]

Empty virtual destructor.

Definition at line 278 of file osbcombos.h.


Member Function Documentation

template<typename Value>
int OSB_GUI::ValueCombo< Value >::addValue ( const Value &  value,
const QPixmap &  pixmap,
const std::string &  text 
)

Add a value to the combo.

Parameters:
value Value to add.
pixmap Text for value.
text Text for value.
Returns:
The index of the added value.

Definition at line 346 of file osbcombos.h.

References OSB_GUI::ValueCombo< Value >::valueMap_.

template<typename Value>
int OSB_GUI::ValueCombo< Value >::addValue ( const Value &  value,
const std::string &  text 
)

Add a value to the combo.

Parameters:
value Value to add.
text Text for value.
Returns:
The index of the added value.

Definition at line 334 of file osbcombos.h.

References OSB_GUI::ValueCombo< Value >::valueMap_.

template<typename Value>
void OSB_GUI::ValueCombo< Value >::clear (  ) 

Remove all entries from the combo box.

Calls QComboBox::clear() and clearValueMap().

Attention:
This overrides the non-virtual (Qt?) method of the base class.

Definition at line 321 of file osbcombos.h.

References OSB_GUI::ValueCombo< Value >::clearValueMap().

template<typename Value>
void OSB_GUI::ValueCombo< Value >::clearValueMap (  )  [protected]

Clear all entries in the value map.

Definition at line 328 of file osbcombos.h.

References OSB_GUI::ValueCombo< Value >::valueMap_.

Referenced by OSB_GUI::ValueCombo< Value >::clear().

template<typename Value>
int OSB_GUI::ValueCombo< Value >::getIndex ( const Value &  value  )  const

Get the index of a value.

Returns:
-1 if value can not be found.

Definition at line 300 of file osbcombos.h.

References OSB_GUI::ValueCombo< Value >::valueMap_.

Referenced by OSB_GUI::ValueCombo< Value >::select(), and OSB_GUI::ValueCombo< Value >::setText().

template<typename Value>
Value OSB_GUI::ValueCombo< Value >::getValue ( int  index  )  const

Get value at an index.

Returns:
valueMap_[index] or Value() if the index is not valid.

Definition at line 284 of file osbcombos.h.

References OSB_GUI::ValueCombo< Value >::valueMap_.

template<typename Value>
Value OSB_GUI::ValueCombo< Value >::getValue (  )  const

Get the selected value.

Gets the index for the current item and returns the value from valueMap_ or Value() if the index is not valid.

Definition at line 293 of file osbcombos.h.

template<typename Value>
int OSB_GUI::ValueCombo< Value >::select ( const Value &  value  ) 

Set the selected value.

Parameters:
value Value to select.
Returns:
The index of the selected item.

Definition at line 313 of file osbcombos.h.

References OSB_GUI::ValueCombo< Value >::getIndex().

template<typename Value>
int OSB_GUI::ValueCombo< Value >::setText ( const Value &  value,
const std::string &  text 
)

Change the text for a value.

Parameters:
value Value to change.
text Text for value.
Returns:
The index of the changed value.

Definition at line 359 of file osbcombos.h.

References OSB_GUI::ValueCombo< Value >::getIndex().


Member Data Documentation

template<typename Value>
ValueMap OSB_GUI::ValueCombo< Value >::valueMap_ [private]

Map index <-> Value.

Definition at line 211 of file osbcombos.h.

Referenced by OSB_GUI::ValueCombo< Value >::addValue(), OSB_GUI::ValueCombo< Value >::clearValueMap(), OSB_GUI::ValueCombo< Value >::getIndex(), and OSB_GUI::ValueCombo< Value >::getValue().


The documentation for this class was generated from the following file:
Generated on Sat Sep 2 14:18:48 2006 for OSB Library by  doxygen 1.4.7