MLABTree Class Reference
[GUI ControlsCommon GUI Controls]

List of all members.

Public Slots

Scripting access
void append (MLABTree *child)
MLABTreeappend (const QString &name, const QString &value)
MLABTreechild (int i)
QString childValue (const QString &name)
int count ()
MLABTreefindChild (const QString &name)
MLABTreefindChildren (const QString &name)
MLABTreefindChildrenRecursive (const QString &name)
MLABTreeget (QString propertyName, QVariant defaultVal=QVariant())
QVariantList getAll (QString propertyName)
QStringList getAllChildNames ()
bool getBoolValue ()
float getFloatValue ()
int getIntValue ()
int getLine ()
QStringList getListValue ()
QString getName ()
QRect getRectValue ()
int getScaledIntValue (float scaleFactor)
QSize getSizeValue ()
unsigned long getUlongValue ()
QString getValue ()
int getValueLine ()
QString getValueResolveEscapes ()
void insert (int idx, MLABTree *child)
MLABTreeinsert (int idx, const QString &name, const QString &value)
void printError (const QString &msg)
void printWarning (const QString &msg)
bool remove (MLABTree *child)
void setBoolValue (bool val)
void setFloatValue (float val)
void setIntValue (int val)
void setListValue (QStringList val)
void setName (const QString &name)
void setRectValue (QRect val)
void setSizeValue (QSize val)
void setUlongValue (unsigned long val)
void setValue (const QString &value)
QString toString ()


Detailed Description

MLAB Tree element of parsed MDL files. The items can be created with MLAB::newTree() and can be loaded/saved via MLAB::readTreeFromFile(),MLAB::readTreeFromString() and MLAB::writeTreeToFile(), MLAB::writeTreeToString().

Member Function Documentation

void MLABTree::append ( MLABTree child  )  [slot]

appends a given tree child

MLABTree* MLABTree::append ( const QString &  name,
const QString &  value 
) [slot]

appends a new tree child

MLABTree* MLABTree::child ( int  i  )  [slot]

returns child at index i

QString MLABTree::childValue ( const QString &  name  )  [slot]

searches for the direct child with name and returns the first encountered child's value or an empty string (search is case insensitive)

int MLABTree::count (  )  [slot]

returns count of direct children (non-recursive)

MLABTree* MLABTree::findChild ( const QString &  name  )  [slot]

searches for the direct child with name and returns the first encountered child or NULL (search is case insensitive)

MLABTree* MLABTree::findChildren ( const QString &  name  )  [slot]

searches for the direct children with name and returns a tree which contains the found children (search is case insensitive)

MLABTree* MLABTree::findChildrenRecursive ( const QString &  name  )  [slot]

searches for the children with name recursively and returns a tree which contains the found children (search is case insensitive)

MLABTree* MLABTree::get ( QString  propertyName,
QVariant  defaultVal = QVariant() 
) [slot]

get property by name.

One can use dot-notation to access children. Return first child with name propertyName.split(".")[-1] Return defaultVal if not found Example: get("Interface.Inputs.Field")

QVariantList MLABTree::getAll ( QString  propertyName  )  [slot]

get all properties by name.

One can use dot-notation to access children. Return all children with name propertyName.split(".")[-1] Return defaultVal if not found

QStringList MLABTree::getAllChildNames (  )  [slot]

get names of all child tree node

bool MLABTree::getBoolValue (  )  [slot]

return if the value is true or false (yes/true/1)

float MLABTree::getFloatValue (  )  [slot]

return the value as float

int MLABTree::getIntValue (  )  [slot]

return the value as integer

int MLABTree::getLine (  )  [slot]

Get the line of the file, where this tag was defined.

QStringList MLABTree::getListValue (  )  [slot]

get/set value as a list A string value is separated at ',' e.g.

: a value of "1, 4, 3, 44" would be returned as ("1", "4", "3", "44")

QString MLABTree::getName (  )  [slot]

get name of the tree node

QRect MLABTree::getRectValue (  )  [slot]

get/set qrect value of this tree (by parsing the value string) A rect as a string value looks like this: "100 100 20 40" (x y w h)

int MLABTree::getScaledIntValue ( float  scaleFactor  )  [slot]

return the value as scaled integer

QSize MLABTree::getSizeValue (  )  [slot]

get/set qsize value of this tree (by parsing the value string) A size as a string value looks like this: "100 100" (w h)

unsigned long MLABTree::getUlongValue (  )  [slot]

return the value as unsigned long

QString MLABTree::getValue (  )  [slot]

get value of the tree node

int MLABTree::getValueLine (  )  [slot]

Get the line of the file, where this tags value was defined.

QString MLABTree::getValueResolveEscapes (  )  [slot]

Get Value of this tree with resolved escape-sequences.

Get Value of this tree with resolved escape-sequences

Returns:
Value of this tree

void MLABTree::insert ( int  idx,
MLABTree child 
) [slot]

inserts a given tree child

MLABTree* MLABTree::insert ( int  idx,
const QString &  name,
const QString &  value 
) [slot]

inserts a new tree child at the given position (i must be between 0 and count()-1)

void MLABTree::printError ( const QString &  msg  )  [slot]

prints an error to the console for this tree

void MLABTree::printWarning ( const QString &  msg  )  [slot]

prints a warning to the console for this tree

bool MLABTree::remove ( MLABTree child  )  [slot]

remove a given tree child

void MLABTree::setName ( const QString &  name  )  [slot]

sets the name of the tree, be careful, since it affects all trees which reference this tree

void MLABTree::setValue ( const QString &  value  )  [slot]

sets the name of the tree, be careful, since it affects all trees which reference this tree

QString MLABTree::toString (  )  [inline, slot]

get MDL string with whole recursive tree (excluding the root item on which this method is called)


Generated on Sat Sep 3 18:38:03 2011 for MeVisLab Scripting Reference by  doxygen 1.5.8