Optika GUI Toolik  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members
Optika::TreeItem Class Reference

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

#include <Optika_treeitem.hpp>

Constructors/Destructor

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

Debugging fucntions

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

Getters and Setters

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

Private Members

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

Private Functions

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

Detailed Description

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

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

Optika::TreeItem::~TreeItem ( )

Deconstrcutor for the TreeItem.

Definition at line 74 of file Optika_treeitem.cpp.

Member Function Documentation

void Optika::TreeItem::printOut ( ) const

Prints out the values in the TreeItem.

Definition at line 78 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 89 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 105 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 113 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 93 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 97 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 101 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 105 of file Optika_treeitem.cpp.

TreeItem * Optika::TreeItem::parent ( )

Gets the parent TreeItem.

Returns
The parent TreeItem.

Definition at line 197 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 201 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 208 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 227 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 85 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 242 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 289 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 336 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 293 of file Optika_treeitem.cpp.

Member Data Documentation

const QString Optika::TreeItem::name
private

the name of the tree item.

Definition at line 223 of file Optika_treeitem.hpp.

QString Optika::TreeItem::myTypeId
private

The type id associated with this TreeItem.

Definition at line 228 of file Optika_treeitem.hpp.

QList<TreeItem*> Optika::TreeItem::childItems
private

The childitems of the TreeItem.

Definition at line 233 of file Optika_treeitem.hpp.

TreeItem* Optika::TreeItem::parentItem
private

The parent TreeItem.

Definition at line 238 of file Optika_treeitem.hpp.

RCP<ParameterEntry> Optika::TreeItem::parameterEntry
private

The ParameterEntry being represented by the TreeItem.

Definition at line 243 of file Optika_treeitem.hpp.

QString Optika::TreeItem::docString
private

The docString for the TreeItem.

Definition at line 248 of file Optika_treeitem.hpp.

bool Optika::TreeItem::isHeader
private

Whether or not this is a header treeitem.

Definition at line 253 of file Optika_treeitem.hpp.


The documentation for this class was generated from the following files: