OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
ot::TreeWidget Class Reference

#include "TreeWidget.h"

Inheritance diagram for ot::TreeWidget:
ot::QWidgetInterface GraphicsItemDesignerNavigation ot::PropertyGridTree

Classes

struct  ItemInformation
 

Public Member Functions

 TreeWidget (QWidget *_parentWidget=(QWidget *) nullptr)
 
virtual ~TreeWidget ()
 
virtual QWidget * getQWidget (void) override
 Returns a pointer to the root widget of this object.
 
virtual const QWidget * getQWidget (void) const override
 
QTreeWidgetItem * findItem (const QString &_itemPath, char _delimiter='/') const
 
bool itemExists (const QString &_itemPath, char _delimiter='/') const
 Checks if the item at the given path exists.
 
bool itemTextExists (const QString &_itemText) const
 Checks if an item with the given text exists. The item text is the text of the single item. The item to check may be nested.
 
QString getItemPath (QTreeWidgetItem *_item, char _delimiter='/') const
 
QTreeWidgetItem * addItem (const TreeWidgetItemInfo &_item)
 
void deselectAll (void)
 Deselects all items. Emits itemSelectionChanged when done.
 
virtual void mousePressEvent (QMouseEvent *_event) override
 
virtual void drawRow (QPainter *_painter, const QStyleOptionViewItem &_options, const QModelIndex &_index) const override
 
bool itemTextExists (QTreeWidgetItem *_parent, const QString &_itemText) const
 Checks if an item with the given text exists. The item text is the text of the single item. The item to check may be nested.
 
QTreeWidgetItem * findItem (QTreeWidgetItem *_item, const QStringList &_childPath) const
 
QTreeWidgetItem * findItemText (QTreeWidgetItem *_parent, const QString &_itemText) const
 
- Public Member Functions inherited from ot::QWidgetInterface
 QWidgetInterface ()
 
virtual ~QWidgetInterface ()
 
void setOTWidgetFlags (const WidgetFlags &_flags)
 
const WidgetFlagsotWidgetFlags (void) const
 

Additional Inherited Members

- Protected Member Functions inherited from ot::QWidgetInterface
virtual void otWidgetFlagsChanged (const WidgetFlags &_flags)
 

Constructor & Destructor Documentation

◆ TreeWidget()

ot::TreeWidget::TreeWidget ( QWidget * _parentWidget = (QWidget*)nullptr)

◆ ~TreeWidget()

ot::TreeWidget::~TreeWidget ( )
virtual

Member Function Documentation

◆ addItem()

QTreeWidgetItem * ot::TreeWidget::addItem ( const TreeWidgetItemInfo & _item)

◆ deselectAll()

void ot::TreeWidget::deselectAll ( void )

Deselects all items. Emits itemSelectionChanged when done.

◆ drawRow()

void ot::TreeWidget::drawRow ( QPainter * _painter,
const QStyleOptionViewItem & _options,
const QModelIndex & _index ) const
overridevirtual

Reimplemented in ot::PropertyGridTree.

◆ findItem() [1/2]

QTreeWidgetItem * ot::TreeWidget::findItem ( const QString & _itemPath,
char _delimiter = '/' ) const

◆ findItem() [2/2]

QTreeWidgetItem * ot::TreeWidget::findItem ( QTreeWidgetItem * _item,
const QStringList & _childPath ) const

◆ findItemText()

QTreeWidgetItem * ot::TreeWidget::findItemText ( QTreeWidgetItem * _parent,
const QString & _itemText ) const

◆ getItemPath()

QString ot::TreeWidget::getItemPath ( QTreeWidgetItem * _item,
char _delimiter = '/' ) const

◆ getQWidget() [1/2]

virtual const QWidget * ot::TreeWidget::getQWidget ( void ) const
inlineoverridevirtual

Implements ot::QWidgetInterface.

◆ getQWidget() [2/2]

virtual QWidget * ot::TreeWidget::getQWidget ( void )
inlineoverridevirtual

Returns a pointer to the root widget of this object.

Implements ot::QWidgetInterface.

◆ itemExists()

bool ot::TreeWidget::itemExists ( const QString & _itemPath,
char _delimiter = '/' ) const
inline

Checks if the item at the given path exists.

Parameters
_itemPathPath to the item (e.g. "Root/Child/Item" for a delimiter '/').
_delimiterDelimiter to separate the item path.

◆ itemTextExists() [1/2]

bool ot::TreeWidget::itemTextExists ( const QString & _itemText) const

Checks if an item with the given text exists. The item text is the text of the single item. The item to check may be nested.

Parameters
_itemTextText to check.

◆ itemTextExists() [2/2]

bool ot::TreeWidget::itemTextExists ( QTreeWidgetItem * _parent,
const QString & _itemText ) const

Checks if an item with the given text exists. The item text is the text of the single item. The item to check may be nested.

Parameters
_parentThe parent item to check the childs.
_itemTextText to check.

◆ mousePressEvent()

void ot::TreeWidget::mousePressEvent ( QMouseEvent * _event)
overridevirtual

Reimplemented in ot::PropertyGridTree.


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