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

Method parent

YACReaderLibrary/db/reading_list_model.cpp:166–182  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

164}
165
166QModelIndex ReadingListModel::parent(const QModelIndex &index) const
167{
168
169 if (!index.isValid())
170 return QModelIndex();
171
172 auto item = static_cast<ListItem *>(index.internalPointer());
173
174 if (typeid(*item) == typeid(ReadingListItem)) {
175 auto childItem = static_cast<ReadingListItem *>(index.internalPointer());
176 ReadingListItem *parent = childItem->parent;
177 if (parent->getId() != 0)
178 return createIndex(parent->row() + specialLists.count() + labels.count() + 2, 0, parent);
179 }
180
181 return QModelIndex();
182}
183
184bool ReadingListModel::canDropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const
185{

Callers 4

dropComicsMethod · 0.45
dropSublistMethod · 0.45
mimeDataMethod · 0.45
deleteItemMethod · 0.45

Calls 4

QModelIndexClass · 0.50
isValidMethod · 0.45
getIdMethod · 0.45
rowMethod · 0.45

Tested by

no test coverage detected