Optika GUI Toolik
Version of the Day
|
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 | |
TreeItem * | child (int row) |
Returns the child treeitem in the row specified by the row argument. More... | |
RCP< const ParameterEntry > | getEntry () 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... | |
TreeItem * | parent () |
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... | |
TreeItem * | parentItem |
The parent TreeItem. More... | |
RCP< ParameterEntry > | parameterEntry |
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... | |
The TreeItem class is the item class used by the TreeModel class.
Definition at line 56 of file Optika_treeitem.hpp.
Optika::TreeItem::TreeItem | ( | const QString & | name, |
RCP< ParameterEntry > | parameterEntry, | ||
TreeItem * | parent = 0 , |
||
bool | isHeader = false |
||
) |
Constructs a TreeItem object.
name | The name of the parameter entry. |
parameterEntry | The ParameterEntry this TreeItem is ment to represent. |
parent | The parent TreeItem. |
isHeader | Whether 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.
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.
row | The row in which the child is in. |
Definition at line 89 of file Optika_treeitem.cpp.
|
inline |
Gets the ParameterEntry associated with this TreeItem.
Definition at line 105 of file Optika_treeitem.hpp.
|
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.
Definition at line 93 of file Optika_treeitem.cpp.
const QList< TreeItem * > Optika::TreeItem::getChildItems | ( | ) |
Gets a list of all the 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.
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.
column | The column of the desired data. |
role | The role of the data. |
Definition at line 105 of file Optika_treeitem.cpp.
TreeItem * Optika::TreeItem::parent | ( | ) |
Gets 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.
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.
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.
Definition at line 227 of file Optika_treeitem.cpp.
void Optika::TreeItem::appendChild | ( | TreeItem * | child | ) |
Appends a child TreeItem to the TreeItem.
child | The 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.
value | The 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.
validator | The validator which the parameter should be given. |
Definition at line 289 of file Optika_treeitem.cpp.
|
static |
Gets the type id to be used for the TreeItem.
param | The parameter who's type is in question. |
Definition at line 336 of file Optika_treeitem.cpp.
|
private |
Changes the value of an array.
value | A string representing the value of the array. |
type | The type of array. |
Definition at line 293 of file Optika_treeitem.cpp.
|
private |
the name of the tree item.
Definition at line 223 of file Optika_treeitem.hpp.
|
private |
The type id associated with this TreeItem.
Definition at line 228 of file Optika_treeitem.hpp.
|
private |
The childitems of the TreeItem.
Definition at line 233 of file Optika_treeitem.hpp.
|
private |
The parent TreeItem.
Definition at line 238 of file Optika_treeitem.hpp.
|
private |
The ParameterEntry being represented by the TreeItem.
Definition at line 243 of file Optika_treeitem.hpp.
|
private |
The docString for the TreeItem.
Definition at line 248 of file Optika_treeitem.hpp.
|
private |
Whether or not this is a header treeitem.
Definition at line 253 of file Optika_treeitem.hpp.