MCPcopy Create free account
hub / github.com/dail8859/NotepadNext / data

Method data

src/MacroStepTableModel.cpp:53–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53QVariant MacroStepTableModel::data(const QModelIndex &index, int role) const
54{
55 if (!index.isValid())
56 return QVariant();
57
58 if (role == Qt::DisplayRole || role == Qt::EditRole || role == Qt::ToolTipRole) {
59 switch (index.column()) {
60 case 0:
61 if (role == Qt::EditRole) {
62 return static_cast<int>(macro->getSteps()[index.row()].message);
63 }
64 else {
65 return macro->getSteps()[index.row()].getName();
66 }
67 case 1:
68 return macro->getSteps()[index.row()].str;
69 default:
70 break;
71 }
72 }
73
74 return QVariant();
75}
76
77bool MacroStepTableModel::setData(const QModelIndex &index, const QVariant &value, int role)
78{

Callers

nothing calls this directly

Calls 1

getNameMethod · 0.45

Tested by

no test coverage detected