MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / index

Method index

src/plugins/binarytools/models/binarytoolsmodel.cpp:71–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69}
70
71QModelIndex BinaryToolsModel::index(int row, int column, const QModelIndex &parent) const
72{
73 if (column == 0 && parent.isValid()) {
74 bool found;
75 QString group = groupForIndex(parent, &found);
76 if (found) {
77 auto items = binaryTools.value(group);
78 if (row < items.count()) {
79 auto &item = items.at(row);
80 return createIndex(row, 0, const_cast<ToolInfo *>(&item));
81 }
82 }
83 } else if (column == 0 && row < binaryTools.size()) {
84 return createIndex(row, 0);
85 }
86
87 return QModelIndex();
88}
89
90QModelIndex BinaryToolsModel::parent(const QModelIndex &child) const
91{

Callers 5

removeToolMethod · 0.95
addToolMethod · 0.95
handleAddToolMethod · 0.45
handleAddCombinationMethod · 0.45
setIconMethod · 0.45

Calls 6

atMethod · 0.80
QModelIndexClass · 0.50
isValidMethod · 0.45
valueMethod · 0.45
countMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected