MCPcopy Create free account
hub / github.com/cc20110101/RedisView / parent

Method parent

src/RedisView/Model/KeyTreeModel.cpp:201–219  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

199}
200
201QModelIndex KeyTreeModel::parent(const QModelIndex &index) const
202{
203 if (!index.isValid())
204 return QModelIndex();
205
206 KeyTreeItem *childItem = getItem(index);
207 if(childItem == nullptr)
208 return QModelIndex();
209
210 KeyTreeItem *parentItem = childItem->parent();
211
212 if (parentItem == nullptr || parentItem == rootItem)
213 return QModelIndex();
214
215 if(parentItem->parent() == nullptr)
216 return QModelIndex();
217
218 return createIndex(parentItem->childNumber(), 0, parentItem);
219}
220
221bool KeyTreeModel::removeRows(int position, int rows, const QModelIndex &parent)
222{

Callers 1

insertRowMethod · 0.45

Calls 1

childNumberMethod · 0.45

Tested by

no test coverage detected