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

Method data

src/plugins/builder/tasks/taskmodel.cpp:37–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35}
36
37QVariant TaskModel::data(const QModelIndex &index, int role) const
38{
39 int row = index.row();
40 if (!index.isValid() || row < 0 || row >= tasks.count() || index.column() != 0)
41 return QVariant();
42
43 if (role == TaskModel::File)
44 return tasks.at(index.row()).file.toString();
45 else if (role == TaskModel::Line)
46 return tasks.at(index.row()).line;
47 else if (role == TaskModel::MovedLine)
48 return tasks.at(index.row()).movedLine;
49 else if (role == TaskModel::Description)
50 return tasks.at(index.row()).description;
51 else if (role == TaskModel::Type)
52 return static_cast<int>(tasks.at(index.row()).type);
53 else if (role == TaskModel::Icon)
54 return tasks.at(index.row()).icon;
55 else if (role == TaskModel::Task_t)
56 return QVariant::fromValue(task(index));
57 return QVariant();
58}
59
60Task TaskModel::task(const QModelIndex &index) const
61{

Callers 5

sizeHintMethod · 0.45
paintMethod · 0.45
paintItemColumnMethod · 0.45
filterAcceptsRowMethod · 0.45
eventProcessMethod · 0.45

Calls 6

rowMethod · 0.80
columnMethod · 0.80
atMethod · 0.80
isValidMethod · 0.45
countMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected