Optika GUI Toolik Version of the Day
Public Member Functions | Private Member Functions | Private Attributes
Optika::TreeItem Class Reference

#include <Optika_treeitem.hpp>

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::ParameterEntryentry ()
bool hasValidValue () const
bool changeValue (QVariant value)
void setValidator (Teuchos::RCP< const Teuchos::ParameterEntryValidator > validator)

Private Member Functions

void changeValueForArray (QVariant value, QString type)

Private Attributes

bool unrecognized
QList< TreeItem * > childItems
QList< QVariant > itemData
TreeItemparentItem
Teuchos::ParameterEntryparameterEntry
QString docString

Detailed Description

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

Definition at line 41 of file Optika_treeitem.hpp.


Constructor & Destructor Documentation

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

Constructs a TreeItem object.

Parameters:
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.

Definition at line 36 of file Optika_treeitem.cpp.

Optika::TreeItem::~TreeItem ( )

Deconstrcutor for the TreeItem.

Definition at line 56 of file Optika_treeitem.cpp.


Member Function Documentation

void Optika::TreeItem::printOut ( ) const

Prints out the values in the TreeItem.

Definition at line 60 of file Optika_treeitem.cpp.

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

Appends a child TreeItem to the TreeItem

Parameters:
childThe child item to be appended.

Definition at line 71 of file Optika_treeitem.cpp.

TreeItem * Optika::TreeItem::child ( int  row)

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

Parameters:
rowThe row in which the child is in.
Returns:
The child TreeItem located in the row.

Definition at line 75 of file Optika_treeitem.cpp.

int Optika::TreeItem::childCount ( ) const

Gets the number of child nodes this item has.

Returns:
The number of child nodes this item has.

Definition at line 79 of file Optika_treeitem.cpp.

const QList< TreeItem * > Optika::TreeItem::getChildItems ( )

Gets a list of all the child items.

Returns:
A list of all child items.

Definition at line 83 of file Optika_treeitem.cpp.

int Optika::TreeItem::columnCount ( ) const

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

Returns:
The number of columns the TreeItem has.

Definition at line 87 of file Optika_treeitem.cpp.

QVariant Optika::TreeItem::data ( int  column,
int  role = Qt::DisplayRole 
) const

Returns the data located in a particular column.

Parameters:
columnThe column of the desired data.
roleThe role of the data.
Returns:
The data located in a particular column.

Definition at line 91 of file Optika_treeitem.cpp.

TreeItem * Optika::TreeItem::parent ( )

Gets the parent TreeItem

Returns:
The parent TreeItem.

Definition at line 134 of file Optika_treeitem.cpp.

int Optika::TreeItem::row ( ) const

Returns the row in which this TreeItem is located.

Returns:
The row in which this TreeItem is located.

Definition at line 138 of file Optika_treeitem.cpp.

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.

Definition at line 145 of file Optika_treeitem.cpp.

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.

Definition at line 149 of file Optika_treeitem.cpp.

bool Optika::TreeItem::changeValue ( QVariant  value)

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

Parameters:
valueThe new value to be assigned to the TreeItem.

Definition at line 168 of file Optika_treeitem.cpp.

void Optika::TreeItem::setValidator ( Teuchos::RCP< const Teuchos::ParameterEntryValidator validator)

Sets the validator for the parameter the TreeItem represents.

Parameters:
validatorThe validator which the parameter should be given.

Definition at line 197 of file Optika_treeitem.cpp.

void Optika::TreeItem::changeValueForArray ( QVariant  value,
QString  type 
) [private]

Changes the value of an array.

Parameters:
valueA string representing the value of the array.
typeThe type of array.

Definition at line 201 of file Optika_treeitem.cpp.


Member Data Documentation

Whether or not the parameter type is unrecognized.

Definition at line 176 of file Optika_treeitem.hpp.

The childitems of the TreeItem.

Definition at line 181 of file Optika_treeitem.hpp.

QList<QVariant> Optika::TreeItem::itemData [private]

The data in the item.

Definition at line 186 of file Optika_treeitem.hpp.

The parent TreeItem.

Definition at line 191 of file Optika_treeitem.hpp.

The ParameterEntry being represented by the TreeItem.

Definition at line 196 of file Optika_treeitem.hpp.

QString Optika::TreeItem::docString [private]

The docString for the TreeItem.

Definition at line 201 of file Optika_treeitem.hpp.


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