OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
ak::aTreeWidgetItem Class Reference

#include "aTreeWidget.h"

Inheritance diagram for ak::aTreeWidgetItem:
ak::aObject

Public Member Functions

 aTreeWidgetItem (ID _newId, aTreeWidgetItem *_parent=nullptr, int _type=0)
 Constructor.
 
 aTreeWidgetItem (aTreeWidgetBase *_view, ID _newId, aTreeWidgetItem *_parent=nullptr, int _type=0)
 Constructor.
 
virtual ~aTreeWidgetItem ()
 Deconstructor.
 
void AddChild (aTreeWidgetItem *_child)
 Will add a new child to this item.
 
void setParentItem (aTreeWidgetItem *_parent)
 Will set the provided item as the parent item.
 
void setChildsEnabled (bool _enabled)
 Will set the enabled state for every child of this item.
 
void setChildsSelected (bool _selected)
 Will select/deselect the childs of this item.
 
void setChildsVisible (bool _visible)
 Will set the visible state for every child of this item.
 
void ensureTopLevelSelectionVisible ()
 Will expand the most top level item that is selected and is a parent of this item. If this is the top level item, this item will be expanded.
 
void expandAllParents (bool _expandThis)
 Will expand all parent items of this item.
 
void collapse (void)
 Will collapse this item and all of its childs.
 
void setEditable (bool _editable=true)
 
void setLocked (bool _locked=true)
 
void setVisible (bool _isVisible, bool _expandParents=true)
 Will unhide this item if hidden.
 
aTreeWidgetItemfindChild (ID _id)
 Will return a pointer to a top level child with the provided id. Returns nullptr if the item does not exist.
 
aTreeWidgetItemfindChild (const QString &_text)
 Will return a pointer to a top level child with the provided text. Returns nullptr if the item does not exist.
 
ID getItemID (const QStringList &_itemPath, int _currentIndex)
 Will return the ID of the specified item.
 
void eraseChild (ID _id)
 Will erase this child from the information storage This function should only be called from the child itself to clear up its data.
 
bool hasChilds (void)
 Will return true if this item has childs.
 
aTreeWidgetItempopFirstChild (void)
 Will take and remove the first child item of this item.
 
const std::list< aTreeWidgetItem * > & childs (void)
 Will return all next level childs of this item.
 
const std::list< aTreeWidgetItem * > & allChilds (void)
 Will return all childs of this item.
 
const std::list< ID > & allChildsIDs (void)
 Will return the IDs of all childs at this item.
 
int childCount (void) const
 Will return the ammound of childs this item has.
 
ID id (void) const
 Will return the id of the child.
 
ID parentId (void) const
 Will return the id of the parent item Returns -1 if there is no parent item.
 
void setStoredText (const QString &_text)
 Will set the stored text, this value is only used to evaluate the changed event.
 
QString storedText (void) const
 Will return the stored text.
 
std::list< QString > getItemPath ()
 Will return all items from root to this item as a vector where the first item is the root item.
 
QString getItemPathString (char _delimiter='|')
 Will return all items from root to this item as a string seperated with the provided delimiter where the first item is the root item.
 
bool isVisible (void) const
 
aTreeWidgetItemparentItem (void) const
 
void setSelectChilds (bool flag)
 
bool getSelectChilds (void)
 
- Public Member Functions inherited from ak::aObject
 aObject (objectType _type=otNone, UID _UID=ak::invalidUID)
 Constructor.
 
 aObject (const aObject &_other)
 Copy constructor.
 
aObjectoperator= (const aObject &_other)
 Assignment operator.
 
virtual ~aObject ()
 Deconstructor.
 
virtual void removeChildObject (aObject *_child)
 Will remove the child from this object (not destroy it) This function should be called from the deconstructor of a child.
 
virtual void addChildObject (aObject *_child)
 Will add the child to this object.
 
void setUniqueName (const QString &_name)
 Will set this objects unique name.
 
virtual void setParentObject (aObject *_parentObject)
 Will set the parent object of this object.
 
QString uniqueName (void) const
 Will return the unique name of this object.
 
aObjectparentObject (void) const
 Will return a pointer to the parent object.
 
int childObjectCount (void) const
 Will return the count of sub objects.
 
aObjectchildObject (UID _childUID)
 Will return the child with the specified UID.
 
void setOwner (aObject *_object)
 Will set the owner of this object.
 
aObjectowner (void) const
 Will return the owner of this object.
 
void setUid (UID _UID)
 Will set the objects UID.
 
UID uid (void) const
 Returns the objects UID.
 
objectType type (void) const
 Returns the objects type.
 
virtual bool isWidgetType (void) const
 Returns true if the object is an object derived from aWidget.
 

Additional Inherited Members

- Protected Attributes inherited from ak::aObject
UID m_uid
 
int m_references
 The objects UID.
 
objectType m_objectType
 The objects references.
 
QString m_uniqueName
 The object type of this object.
 
aObjectm_parentObject
 
aObjectm_owner
 
std::map< UID, aObject * > m_childObjects
 

Constructor & Destructor Documentation

◆ aTreeWidgetItem() [1/2]

ak::aTreeWidgetItem::aTreeWidgetItem ( ak::ID _newId,
aTreeWidgetItem * _parent = nullptr,
int _type = 0 )

Constructor.

Parameters
_newIdThe ID of this item
_typeThe type of this item

◆ aTreeWidgetItem() [2/2]

ak::aTreeWidgetItem::aTreeWidgetItem ( ak::aTreeWidgetBase * _view,
ak::ID _newId,
aTreeWidgetItem * _parent = nullptr,
int _type = 0 )

Constructor.

Parameters
_viewThe view that creates this item
_newIdThe ID of this item
_typeThe type of this item

◆ ~aTreeWidgetItem()

ak::aTreeWidgetItem::~aTreeWidgetItem ( )
virtual

Deconstructor.

Member Function Documentation

◆ AddChild()

void ak::aTreeWidgetItem::AddChild ( aTreeWidgetItem * _child)

Will add a new child to this item.

Parameters
_childThe child to add

◆ allChilds()

const std::list< ak::aTreeWidgetItem * > & ak::aTreeWidgetItem::allChilds ( void )

Will return all childs of this item.

◆ allChildsIDs()

const std::list< ak::ID > & ak::aTreeWidgetItem::allChildsIDs ( void )

Will return the IDs of all childs at this item.

◆ childCount()

int ak::aTreeWidgetItem::childCount ( void ) const

Will return the ammound of childs this item has.

◆ childs()

const std::list< ak::aTreeWidgetItem * > & ak::aTreeWidgetItem::childs ( void )

Will return all next level childs of this item.

◆ collapse()

void ak::aTreeWidgetItem::collapse ( void )

Will collapse this item and all of its childs.

◆ ensureTopLevelSelectionVisible()

void ak::aTreeWidgetItem::ensureTopLevelSelectionVisible ( )

Will expand the most top level item that is selected and is a parent of this item. If this is the top level item, this item will be expanded.

◆ eraseChild()

void ak::aTreeWidgetItem::eraseChild ( ak::ID _id)

Will erase this child from the information storage This function should only be called from the child itself to clear up its data.

Parameters
_idThe ID of the item to erase

◆ expandAllParents()

void ak::aTreeWidgetItem::expandAllParents ( bool _expandThis)

Will expand all parent items of this item.

Parameters
_expandThisIf true, this item will be expanded

◆ findChild() [1/2]

ak::aTreeWidgetItem * ak::aTreeWidgetItem::findChild ( const QString & _text)

Will return a pointer to a top level child with the provided text. Returns nullptr if the item does not exist.

◆ findChild() [2/2]

ak::aTreeWidgetItem * ak::aTreeWidgetItem::findChild ( ak::ID _id)

Will return a pointer to a top level child with the provided id. Returns nullptr if the item does not exist.

◆ getItemID()

ak::ID ak::aTreeWidgetItem::getItemID ( const QStringList & _itemPath,
int _currentIndex )

Will return the ID of the specified item.

Parameters
_itemPathThe path of the requested item
_delimiterThe delimiter of the item path

◆ getItemPath()

std::list< QString > ak::aTreeWidgetItem::getItemPath ( )

Will return all items from root to this item as a vector where the first item is the root item.

◆ getItemPathString()

QString ak::aTreeWidgetItem::getItemPathString ( char _delimiter = '|')

Will return all items from root to this item as a string seperated with the provided delimiter where the first item is the root item.

Parameters
_itemIdThe ID of the requested item
_delimiterThe delimiter between the items

◆ getSelectChilds()

bool ak::aTreeWidgetItem::getSelectChilds ( void )
inline

◆ hasChilds()

bool ak::aTreeWidgetItem::hasChilds ( void )

Will return true if this item has childs.

◆ id()

ak::ID ak::aTreeWidgetItem::id ( void ) const

Will return the id of the child.

◆ isVisible()

bool ak::aTreeWidgetItem::isVisible ( void ) const
inline

◆ parentId()

ak::ID ak::aTreeWidgetItem::parentId ( void ) const

Will return the id of the parent item Returns -1 if there is no parent item.

◆ parentItem()

aTreeWidgetItem * ak::aTreeWidgetItem::parentItem ( void ) const
inline

◆ popFirstChild()

ak::aTreeWidgetItem * ak::aTreeWidgetItem::popFirstChild ( void )

Will take and remove the first child item of this item.

◆ setChildsEnabled()

void ak::aTreeWidgetItem::setChildsEnabled ( bool _enabled)

Will set the enabled state for every child of this item.

Parameters
_enabledIf true all childs of this item will be enabled

◆ setChildsSelected()

void ak::aTreeWidgetItem::setChildsSelected ( bool _selected)

Will select/deselect the childs of this item.

Parameters
_selectedIf true all childs of this item will be selected

◆ setChildsVisible()

void ak::aTreeWidgetItem::setChildsVisible ( bool _visible)

Will set the visible state for every child of this item.

Parameters
_visibleIf true all childs of this item will be visible

◆ setEditable()

void ak::aTreeWidgetItem::setEditable ( bool _editable = true)

◆ setLocked()

void ak::aTreeWidgetItem::setLocked ( bool _locked = true)

◆ setParentItem()

void ak::aTreeWidgetItem::setParentItem ( aTreeWidgetItem * _parent)

Will set the provided item as the parent item.

Parameters
_parentThe parent item

◆ setSelectChilds()

void ak::aTreeWidgetItem::setSelectChilds ( bool flag)
inline

◆ setStoredText()

void ak::aTreeWidgetItem::setStoredText ( const QString & _text)
inline

Will set the stored text, this value is only used to evaluate the changed event.

◆ setVisible()

void ak::aTreeWidgetItem::setVisible ( bool _isVisible,
bool _expandParents = true )

Will unhide this item if hidden.

Parameters
_expandParentsIf true all parent objects will be expanded

◆ storedText()

QString ak::aTreeWidgetItem::storedText ( void ) const
inline

Will return the stored text.


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