Optika Development
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
Optika::GenericArrayWidget< S > Class Template Reference

#include <Optika_ArrayWidget.hpp>

Inheritance diagram for Optika::GenericArrayWidget< S >:
Inheritance graph
[legend]
Collaboration diagram for Optika::GenericArrayWidget< S >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 GenericArrayWidget (const QModelIndex index, QString type, QWidget *parent=0)
QString getType ()
virtual std::string saveData ()=0
virtual void initializeValues (QString values)=0
virtual void accept ()=0

Protected Types

typedef std::vector< QWidget * > WVector

Protected Member Functions

void setupArrayLayout ()

Protected Attributes

WVector widgetVector
TreeModelmodel
QModelIndex index
Teuchos::RCP< const
Teuchos::ParameterEntryValidator > 
entryValidator

Detailed Description

template<class S>
class Optika::GenericArrayWidget< S >

A templated abstract base class for all other array editing widgets. Note the absence of the Q_OBJECT macro. This is becuase classes using the Q_OBJECT macro can't be templated (bummer). The macro is therfore present in the subclasses.


Member Typedef Documentation

template<class S>
typedef std::vector<QWidget*> Optika::GenericArrayWidget< S >::WVector [protected]

Convienece typedef. Represents an array of QWidgets.


Constructor & Destructor Documentation

template<class S>
Optika::GenericArrayWidget< S >::GenericArrayWidget ( const QModelIndex  index,
QString  type,
QWidget *  parent = 0 
) [inline]

Constructs a GenericArrayWidget.

Parameters:
indexThe index of the array that is being edited.
typeThe type of the array.
parentThe parent widget.

Member Function Documentation

template<class S>
virtual void Optika::GenericArrayWidget< S >::accept ( ) [pure virtual]

Called when the user has entered in their desired values and is done editing the array. When reimplemented in a subclass, it should be a slot.

Implemented in Optika::IntArrayWidget, Optika::ShortArrayWidget, Optika::DoubleArrayWidget, Optika::FloatArrayWidget, and Optika::StringArrayWidget.

template<class S>
QString Optika::GenericArrayWidget< S >::getType ( ) [inline]

Gets the type of array being edited.

Returns:
The type of array being edited.
template<class S>
virtual void Optika::GenericArrayWidget< S >::initializeValues ( QString  values) [pure virtual]

Sets all of the values in the array widget to what they initially should be. When reimplemented in a subclass, it should be a slot.

Parameters:
valuesThe values to which the array should be set.

Implemented in Optika::IntArrayWidget, Optika::ShortArrayWidget, Optika::DoubleArrayWidget, Optika::FloatArrayWidget, and Optika::StringArrayWidget.

template<class S>
virtual std::string Optika::GenericArrayWidget< S >::saveData ( ) [pure virtual]

Gets a string representing what should be saved back to the model. When reimplemented in a subclass, it should be a slot.

Returns:
A string representing what should be saved back to the model.

Implemented in Optika::IntArrayWidget, Optika::ShortArrayWidget, Optika::DoubleArrayWidget, Optika::FloatArrayWidget, and Optika::StringArrayWidget.

template<class S>
void Optika::GenericArrayWidget< S >::setupArrayLayout ( ) [inline, protected]

Sets up the layout for the arrayContainer, including adding what ever editing widget should be used for the particual type of array.


Member Data Documentation

template<class S>
Teuchos::RCP<const Teuchos::ParameterEntryValidator> Optika::GenericArrayWidget< S >::entryValidator [protected]

The validator being used on the array.

template<class S>
QModelIndex Optika::GenericArrayWidget< S >::index [protected]

The index in the TreeModel of the parameter the ArrayWidget is editing.

template<class S>
TreeModel* Optika::GenericArrayWidget< S >::model [protected]

A pointer to the TreeModel the ArrayWidget is editing.

template<class S>
WVector Optika::GenericArrayWidget< S >::widgetVector [protected]

Conatins the editing widgets (e.g. QLineEdits and QSpinBoxes) comprising the array editor.


The documentation for this class was generated from the following file:
 All Classes Functions Variables Typedefs Enumerations