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

Method flags

YACReaderLibrary/db/reading_list_model.cpp:100–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98}
99
100Qt::ItemFlags ReadingListModel::flags(const QModelIndex &index) const
101{
102 if (!index.isValid())
103 return { };
104
105 auto item = static_cast<ListItem *>(index.internalPointer());
106 if (typeid(*item) == typeid(ReadingListSeparatorItem))
107 return { };
108
109 if (typeid(*item) == typeid(ReadingListItem) && static_cast<ReadingListItem *>(item)->parent->getId() != 0)
110 return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsDropEnabled | Qt::ItemIsDragEnabled; // only sublists are dragable
111
112 return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsDropEnabled;
113}
114
115QVariant ReadingListModel::headerData(int section, Qt::Orientation orientation, int role) const
116{

Callers

nothing calls this directly

Calls 2

isValidMethod · 0.45
getIdMethod · 0.45

Tested by

no test coverage detected