Optika::TreeItem Class Reference

#include <Optika_treeitem.hpp>

Collaboration diagram for Optika::TreeItem:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 TreeItem (const QList< QVariant > &data, Teuchos::ParameterEntry *parameterEntry, TreeItem *parent=0, bool unrecognized=false)
 ~TreeItem ()
void printOut () const
void appendChild (TreeItem *child)
TreeItemchild (int row)
int childCount () const
const QList< TreeItem * > getChildItems ()
int columnCount () const
QVariant data (int column, int role=Qt::DisplayRole) const
TreeItemparent ()
int row () const
const Teuchos::ParameterEntry * entry ()
bool hasValidValue () const
bool changeValue (QVariant value)
void setValidator (Teuchos::RCP< const Teuchos::ParameterEntryValidator > validator)

Detailed Description

The TreeItem class is the item class used by the TreeModel class.


Constructor & Destructor Documentation

Optika::TreeItem::TreeItem ( const QList< QVariant > &  data,
Teuchos::ParameterEntry *  parameterEntry,
TreeItem parent = 0,
bool  unrecognized = false 
)

Constructs a TreeItem object.

Parameters:
data A list of data that should be in the TreeItem. The list should be of length 3 and contain the following data in each respective location:

  1. The name of the parameter
  2. The default value of the parameter
  3. The type of parameter

In the case of a TreeItem representing a ParameterList the data list should contain the following in each respective location:

  1. The name of the ParameterList
  2. An empty string
  3. The "list" parameter type
parameterEntry The ParameterEntry this TreeItem is ment to represent.
parent The parent TreeItem.
unrecognized If true, this item will be unrecognized and not displayed, if false the item will be displayed.
Optika::TreeItem::~TreeItem (  ) 

Deconstrcutor for the TreeItem.


Member Function Documentation

void Optika::TreeItem::appendChild ( TreeItem child  ) 

Appends a child TreeItem to the TreeItem

Parameters:
child The child item to be appended.
bool Optika::TreeItem::changeValue ( QVariant  value  ) 

Changes the value of the TreeItem. Should only be used with TreeItems that represent Parameters.

Parameters:
value The new value to be assigned to the TreeItem.
TreeItem * Optika::TreeItem::child ( int  row  ) 

Returns the child treeitem in the row specified by the row argument.

Parameters:
row The row in which the child is in.
Returns:
The child TreeItem located in the row.
int Optika::TreeItem::childCount (  )  const

Gets the number of child nodes this item has.

Returns:
The number of child nodes this item has.
int Optika::TreeItem::columnCount (  )  const

How man columns the TreeItem has. Should always be 3.

Returns:
The number of columns the TreeItem has.
QVariant Optika::TreeItem::data ( int  column,
int  role = Qt::DisplayRole 
) const

Returns the data located in a particular column.

Parameters:
column The column of the desired data.
role The role of the data.
Returns:
The data located in a particular column.
const Teuchos::ParameterEntry * Optika::TreeItem::entry (  ) 

Gets the ParameterEntry associated with this TreeItem if it has one.

Returns:
The ParameterEntry associated with this TreeItem if it has one.
const QList< TreeItem * > Optika::TreeItem::getChildItems (  ) 

Gets a list of all the child items.

Returns:
A list of all child items.
bool Optika::TreeItem::hasValidValue (  )  const

Determines whether or not the current value associated with the TreeItem is valid.

Returns:
True if the value is valid, false otherwise.
TreeItem * Optika::TreeItem::parent (  ) 

Gets the parent TreeItem

Returns:
The parent TreeItem.
void Optika::TreeItem::printOut (  )  const

Prints out the values in the TreeItem.

int Optika::TreeItem::row (  )  const

Returns the row in which this TreeItem is located.

Returns:
The row in which this TreeItem is located.
void Optika::TreeItem::setValidator ( Teuchos::RCP< const Teuchos::ParameterEntryValidator >  validator  ) 

Sets the validator for the parameter the TreeItem represents.

Parameters:
validator The validator which the parameter should be given.

The documentation for this class was generated from the following files:
 All Classes Functions Variables Typedefs Enumerations
Generated on Wed Apr 13 10:05:55 2011 for Optika by  doxygen 1.6.3