Optika GUI Toolik Version of the Day
Optika::TreeItem Class Reference

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

#include <Optika_treeitem.hpp>

List of all members.

Constructors/Destructor

 TreeItem (const QString &name, RCP< ParameterEntry > parameterEntry, TreeItem *parent=0, bool isHeader=false)
 Constructs a TreeItem object.
 ~TreeItem ()
 Deconstrcutor for the TreeItem.

Debugging fucntions

void printOut () const
 Prints out the values in the TreeItem.

Getters and Setters

TreeItemchild (int row)
 Returns the child treeitem in the row specified by the row argument.
RCP< const ParameterEntrygetEntry () const
 Gets the ParameterEntry associated with this TreeItem.
bool hasEntry () const
 Returns whether or not this TreeItem has a ParameterEntry associated with it.
int childCount () const
 Gets the number of child nodes this item has.
const QList< TreeItem * > getChildItems ()
 Gets a list of all the child items.
int columnCount () const
 How man columns the TreeItem has. Should always be 3.
QVariant data (int column, int role=Qt::DisplayRole) const
 Returns the data located in a particular column.
TreeItemparent ()
 Gets the parent TreeItem.
int row () const
 Returns the row in which this TreeItem is located.
bool hasValidValue () const
 Determines whether or not the current value associated with the TreeItem is valid.
QString getCurrentInvalidValueMessage () const
 Gets a message desribing the error with the current value.
void appendChild (TreeItem *child)
 Appends a child TreeItem to the TreeItem.
bool changeValue (QVariant value)
 Changes the value of the TreeItem. Should only be used with TreeItems that represent Parameters.
void setValidator (RCP< const ParameterEntryValidator > validator)
 Sets the validator for the parameter the TreeItem represents.
static QString getTypeId (const RCP< const ParameterEntry > parameter)
 Gets the type id to be used for the TreeItem.

Private Members

const QString name
 the name of the tree item.
QString myTypeId
 The type id associated with this TreeItem.
QList< TreeItem * > childItems
 The childitems of the TreeItem.
TreeItemparentItem
 The parent TreeItem.
RCP< ParameterEntryparameterEntry
 The ParameterEntry being represented by the TreeItem.
QString docString
 The docString for the TreeItem.
bool isHeader
 Whether or not this is a header treeitem.

Private Functions

void changeValueForArray (QVariant value, QString type, bool twoD=false)
 Changes the value of an array.

Detailed Description

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

Definition at line 43 of file Optika_treeitem.hpp.


Constructor & Destructor Documentation

Optika::TreeItem::TreeItem ( const QString &  name,
RCP< ParameterEntry parameterEntry,
TreeItem parent = 0,
bool  isHeader = false 
)

Constructs a TreeItem object.

Parameters:
nameThe name of the parameter entry.
parameterEntryThe ParameterEntry this TreeItem is ment to represent.
parentThe parent TreeItem.
isHeaderWhether or not his treeitem represents a "header" tree item.

Definition at line 37 of file Optika_treeitem.cpp.

Optika::TreeItem::~TreeItem ( )

Deconstrcutor for the TreeItem.

Definition at line 61 of file Optika_treeitem.cpp.


Member Function Documentation

void Optika::TreeItem::printOut ( ) const

Prints out the values in the TreeItem.

Definition at line 65 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 76 of file Optika_treeitem.cpp.

RCP<const ParameterEntry> Optika::TreeItem::getEntry ( ) const [inline]

Gets the ParameterEntry associated with this TreeItem.

Returns:
The ParameterEntry associated with this TreeItem. If this tree item does not have a parameterEntry, null is returned.

Definition at line 92 of file Optika_treeitem.hpp.

bool Optika::TreeItem::hasEntry ( ) const [inline]

Returns whether or not this TreeItem has a ParameterEntry associated with it.

Definition at line 100 of file Optika_treeitem.hpp.

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 80 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 84 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 88 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 92 of file Optika_treeitem.cpp.

TreeItem * Optika::TreeItem::parent ( )

Gets the parent TreeItem.

Returns:
The parent TreeItem.

Definition at line 177 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 181 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 188 of file Optika_treeitem.cpp.

QString Optika::TreeItem::getCurrentInvalidValueMessage ( ) const

Gets a message desribing the error with the current value.

This funciton returns the error message generated by the validator should this treeitem's current value be invalid. If the current value is actually valid then this function simply returns an empty string. If there is no validator on this treeitem then an empty string is returned.

Returns:
The error message generated by the validator. If the current value is valid or there is no validator then the string is empty.

Definition at line 207 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 72 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 222 of file Optika_treeitem.cpp.

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

Sets the validator for the parameter the TreeItem represents.

Parameters:
validatorThe validator which the parameter should be given.

Definition at line 269 of file Optika_treeitem.cpp.

QString Optika::TreeItem::getTypeId ( const RCP< const ParameterEntry parameter) [static]

Gets the type id to be used for the TreeItem.

Parameters:
paramThe parameter who's type is in question.
Returns:
The type id for the parameter.

Definition at line 316 of file Optika_treeitem.cpp.

void Optika::TreeItem::changeValueForArray ( QVariant  value,
QString  type,
bool  twoD = false 
) [private]

Changes the value of an array.

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

Definition at line 273 of file Optika_treeitem.cpp.


Member Data Documentation

const QString Optika::TreeItem::name [private]

the name of the tree item.

Definition at line 210 of file Optika_treeitem.hpp.

QString Optika::TreeItem::myTypeId [private]

The type id associated with this TreeItem.

Definition at line 215 of file Optika_treeitem.hpp.

The childitems of the TreeItem.

Definition at line 220 of file Optika_treeitem.hpp.

The parent TreeItem.

Definition at line 225 of file Optika_treeitem.hpp.

The ParameterEntry being represented by the TreeItem.

Definition at line 230 of file Optika_treeitem.hpp.

QString Optika::TreeItem::docString [private]

The docString for the TreeItem.

Definition at line 235 of file Optika_treeitem.hpp.

Whether or not this is a header treeitem.

Definition at line 240 of file Optika_treeitem.hpp.


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