Optika Development
Public Member Functions
Optika::TreeItem Class Reference

#include <Optika_treeitem.hpp>

Collaboration diagram for Optika::TreeItem:
Collaboration graph

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.

dataA 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
parameterEntryThe ParameterEntry this TreeItem is ment to represent.
parentThe parent TreeItem.
unrecognizedIf 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

childThe 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.

valueThe 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.

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

Gets the number of child nodes this item has.

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

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

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.

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

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

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

Gets a list of all the child items.

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

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

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

Gets the parent TreeItem

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.

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.

validatorThe validator which the parameter should be given.

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