Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
ModelHelperTreeItem< Item > Class Template Reference

Base class to inherit basic tree item from. More...

#include <tree_model_helpers.h>

Public Member Functions

 ModelHelperTreeItem (Item *parent)
 Constructs a new ModelHelperTreeItem.
 
virtual ~ModelHelperTreeItem ()
 Destroys the ModelHelperTreeItem and its children.
 
void appendChild (Item *child)
 Appends a child item to the end of the children list.
 
void prependChild (Item *child)
 Prepends a child item to the beginning of the children list.
 
void insertChild (int row, Item *child)
 Inserts a child item at the specified row.
 
void removeChild (int row)
 Removes and deletes the child item at the specified row.
 
Item * child (int row)
 Retrieves the child item at the specified row.
 
int childCount () const
 Gets the total number of child items.
 
int row ()
 Gets the row index of this item relative to its parent.
 
Item * parentItem ()
 Retrieves the parent item.
 

Protected Attributes

Item * parent_
 
QList< QVariant > childItems_
 

Detailed Description

template<typename Item>
class ModelHelperTreeItem< Item >

Base class to inherit basic tree item from.

Constructor & Destructor Documentation

◆ ModelHelperTreeItem()

template<typename Item >
ModelHelperTreeItem< Item >::ModelHelperTreeItem ( Item *  parent)
inline

Constructs a new ModelHelperTreeItem.

Parameters
parentPointer to the parent item.

Member Function Documentation

◆ appendChild()

template<typename Item >
void ModelHelperTreeItem< Item >::appendChild ( Item *  child)
inline

Appends a child item to the end of the children list.

Parameters
childPointer to the child item to append.

◆ child()

template<typename Item >
Item * ModelHelperTreeItem< Item >::child ( int  row)
inline

Retrieves the child item at the specified row.

Parameters
rowThe row index of the child to retrieve.
Returns
Pointer to the child item.

◆ childCount()

template<typename Item >
int ModelHelperTreeItem< Item >::childCount ( ) const
inline

Gets the total number of child items.

Returns
The child count.

◆ insertChild()

template<typename Item >
void ModelHelperTreeItem< Item >::insertChild ( int  row,
Item *  child 
)
inline

Inserts a child item at the specified row.

Parameters
rowThe row index at which to insert the child.
childPointer to the child item to insert.

◆ parentItem()

template<typename Item >
Item * ModelHelperTreeItem< Item >::parentItem ( )
inline

Retrieves the parent item.

Returns
Pointer to the parent item.

◆ prependChild()

template<typename Item >
void ModelHelperTreeItem< Item >::prependChild ( Item *  child)
inline

Prepends a child item to the beginning of the children list.

Parameters
childPointer to the child item to prepend.

◆ removeChild()

template<typename Item >
void ModelHelperTreeItem< Item >::removeChild ( int  row)
inline

Removes and deletes the child item at the specified row.

Parameters
rowThe row index of the child to remove.

◆ row()

template<typename Item >
int ModelHelperTreeItem< Item >::row ( )
inline

Gets the row index of this item relative to its parent.

Returns
The row index.

Member Data Documentation

◆ childItems_

template<typename Item >
QList<QVariant> ModelHelperTreeItem< Item >::childItems_
protected

List of child items stored as QVariants.

◆ parent_

template<typename Item >
Item* ModelHelperTreeItem< Item >::parent_
protected

Pointer to the parent item.


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