Public Member Functions | Private Attributes | List of all members
dbutils::gui::TreeItem Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-11-30/DatabaseUtils/cxx/include/GUI/TreeItem.h"

Public Member Functions

 TreeItem (const QVector< QVariant > &data, TreeItem *parent=0)
 
 ~TreeItem ()
 
TreeItemchild (int number)
 
int childCount () const
 
int columnCount () const
 
QVariant data (int column) const
 
bool insertChildren (int position, int count, int columns)
 
TreeItemparent ()
 
bool removeChildren (int position, int count)
 
int childNumber () const
 
bool setData (int column, const QVariant &value)
 
bool isDirty () const
 
void markDirty ()
 
void markClean ()
 
void markBranchDirty ()
 
bool isNew () const
 
void markNew ()
 
void markOld ()
 
bool isLeaf () const
 

Private Attributes

QList< TreeItem * > childItems
 
QVector< QVariant > itemData
 
TreeItemparentItem
 
bool _isDirty
 
bool _isNew
 

Detailed Description

Definition at line 58 of file TreeItem.h.

Constructor & Destructor Documentation

dbutils::gui::TreeItem::TreeItem ( const QVector< QVariant > &  data,
TreeItem parent = 0 
)

Definition at line 53 of file TreeItem.cpp.

References _isDirty, _isNew, data(), itemData, parent(), and parentItem.

Referenced by insertChildren().

54 {
56  itemData = data;
57  _isDirty = false;
58  _isNew = false;
59 }
TreeItem * parentItem
Definition: TreeItem.h:88
TreeItem * parent()
Definition: TreeItem.cpp:108
QVector< QVariant > itemData
Definition: TreeItem.h:87
QVariant data(int column) const
Definition: TreeItem.cpp:89
dbutils::gui::TreeItem::~TreeItem ( )

Definition at line 61 of file TreeItem.cpp.

References childItems.

62 {
63  qDeleteAll(childItems);
64 }
QList< TreeItem * > childItems
Definition: TreeItem.h:86

Member Function Documentation

TreeItem * dbutils::gui::TreeItem::child ( int  number)
int dbutils::gui::TreeItem::childCount ( ) const
int dbutils::gui::TreeItem::childNumber ( ) const
int dbutils::gui::TreeItem::columnCount ( ) const
QVariant dbutils::gui::TreeItem::data ( int  column) const
bool dbutils::gui::TreeItem::insertChildren ( int  position,
int  count,
int  columns 
)

Definition at line 94 of file TreeItem.cpp.

References childItems, confusionMatrixTree::count, data(), check_grl::row, and TreeItem().

Referenced by dbutils::gui::ConfigDataTreeModel::_populateSubTree(), dbutils::gui::ConfigDataTreeModel::addChildRow(), dbutils::gui::ConfigDataTableModel::addRowAfter(), dbutils::gui::ConfigDataTableModel::insertRows(), dbutils::gui::ConfigDataTreeModel::insertRows(), and dbutils::gui::NamedConfigDataModel::loadData().

95 {
97  return false;
98 
99  for (int row = 0; row < count; ++row) {
100  QVector<QVariant> data(columns);
101  TreeItem *item = new TreeItem(data, this);
102  childItems.insert(position, item);
103  }
104 
105  return true;
106 }
TreeItem(const QVector< QVariant > &data, TreeItem *parent=0)
Definition: TreeItem.cpp:53
const XML_Char const XML_Char * data
Definition: expat.h:268
QVariant data(int column) const
Definition: TreeItem.cpp:89
QList< TreeItem * > childItems
Definition: TreeItem.h:86
bool dbutils::gui::TreeItem::isDirty ( ) const
inline
bool dbutils::gui::TreeItem::isLeaf ( ) const
inline

Definition at line 83 of file TreeItem.h.

References childCount().

83 {return childCount() == 0;}
int childCount() const
Definition: TreeItem.cpp:71
bool dbutils::gui::TreeItem::isNew ( ) const
inline
void dbutils::gui::TreeItem::markBranchDirty ( )

Definition at line 134 of file TreeItem.cpp.

References _isDirty, childItems, and compare_h5_caf::idx.

Referenced by markClean(), and dbutils::gui::ConfigDataTreeModel::setData().

135 {
136  _isDirty = true;
137  for (int idx = 0; idx < childItems.count(); ++idx) {
138  childItems.value(idx)->markBranchDirty();
139  }
140 }
QList< TreeItem * > childItems
Definition: TreeItem.h:86
void dbutils::gui::TreeItem::markClean ( )
inline
void dbutils::gui::TreeItem::markDirty ( )
inline
void dbutils::gui::TreeItem::markNew ( )
inline
void dbutils::gui::TreeItem::markOld ( )
inline
TreeItem * dbutils::gui::TreeItem::parent ( )
bool dbutils::gui::TreeItem::removeChildren ( int  position,
int  count 
)
bool dbutils::gui::TreeItem::setData ( int  column,
const QVariant &  value 
)

Definition at line 125 of file TreeItem.cpp.

References itemData.

Referenced by dbutils::gui::ConfigDataTreeModel::_populateSubTree(), dbutils::gui::ConfigDataTreeModel::addChildRow(), dbutils::gui::ConfigDataTableModel::addRowAfter(), dbutils::gui::ConfigDataTableModel::loadData(), dbutils::gui::NamedConfigDataModel::loadData(), dbutils::gui::ConfigDataTableModel::setData(), and dbutils::gui::ConfigDataTreeModel::setData().

126 {
127  if (column < 0 || column >= itemData.size())
128  return false;
129 
130  itemData[column] = value;
131  return true;
132 }
const XML_Char int const XML_Char * value
Definition: expat.h:331
QVector< QVariant > itemData
Definition: TreeItem.h:87

Member Data Documentation

bool dbutils::gui::TreeItem::_isDirty
private

Definition at line 90 of file TreeItem.h.

Referenced by isDirty(), markBranchDirty(), markClean(), markDirty(), and TreeItem().

bool dbutils::gui::TreeItem::_isNew
private

Definition at line 91 of file TreeItem.h.

Referenced by isNew(), markNew(), markOld(), and TreeItem().

QList<TreeItem*> dbutils::gui::TreeItem::childItems
private
QVector<QVariant> dbutils::gui::TreeItem::itemData
private

Definition at line 87 of file TreeItem.h.

Referenced by columnCount(), data(), setData(), and TreeItem().

TreeItem* dbutils::gui::TreeItem::parentItem
private

Definition at line 88 of file TreeItem.h.

Referenced by childNumber(), parent(), and TreeItem().


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