MCPcopy Create free account
hub / github.com/YACReader/yacreader / parent

Method parent

YACReaderLibrary/db/folder_model.cpp:495–507  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

493}
494
495QModelIndex FolderModel::parent(const QModelIndex &index) const
496{
497 if (!index.isValid())
498 return QModelIndex();
499
500 auto childItem = static_cast<FolderItem *>(index.internalPointer());
501 FolderItem *parentItem = childItem->parent();
502
503 if (parentItem == rootItem)
504 return QModelIndex();
505
506 return createIndex(parentItem->row(), 0, parentItem);
507}
508
509int FolderModel::rowCount(const QModelIndex &parent) const
510{

Callers 3

folderFromItemMethod · 0.45
getSubfoldersModelMethod · 0.45
deleteFolderMethod · 0.45

Calls 3

QModelIndexClass · 0.50
isValidMethod · 0.45
rowMethod · 0.45

Tested by

no test coverage detected