MCPcopy Create free account
hub / github.com/OpenDDS/OpenDDS / index

Method index

tools/monitor/MonitorDataModel.cpp:77–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77QModelIndex
78MonitorDataModel::index( TreeNode* node, int column) const
79{
80 // Treat null nodes as the root.
81 if( !node) node = this->root_;
82
83 // We have to reach the root before we can start forming indices.
84 // Retain the row information for the entire path as we traverse it.
85 QList<int> list;
86 for( ; node->parent(); node = node->parent()) {
87 list.append( node->row());
88 }
89
90 // Form the index of the tree root to start from. Use the topmost
91 // non-null node that we found as the root.
92 QModelIndex index = this->QAbstractItemModel::createIndex( 0, column, node);
93
94 // Now we can form index values all the way back to the node of
95 // interest.
96 while( !list.isEmpty()) {
97 index = this->index( list.takeLast(), column, index);
98 }
99 return index;
100}
101
102TreeNode*
103MonitorDataModel::getNode( const QModelIndex &index, bool defaultToRoot) const

Callers 15

updatedMethod · 0.95
getNodeChildrenMethod · 0.80
Q_FOREACHFunction · 0.80
skip_to_struct_memberMethod · 0.80
get_member_id_by_nameMethod · 0.80
copy_fromMethod · 0.80
test_equalityFunction · 0.80
complete_to_dynamic_iMethod · 0.80
TEST_FFunction · 0.80
get_my_alias_structFunction · 0.80
TESTFunction · 0.80

Calls 5

getNodeMethod · 0.95
rowMethod · 0.80
parentMethod · 0.45
appendMethod · 0.45
isEmptyMethod · 0.45

Tested by 2

test_equalityFunction · 0.64
get_art_nameFunction · 0.64