MCPcopy Create free account
hub / github.com/clementgallet/libTAS / data

Method data

src/program/ui/LuaConsoleModel.cpp:65–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63}
64
65QVariant LuaConsoleModel::data(const QModelIndex &index, int role) const
66{
67 const Lua::LuaFunctionList& lfl = Lua::Callbacks::getList();
68
69 if (index.column() == 0 && role == Qt::CheckStateRole) {
70 if (lfl.activeState(index.row()))
71 return Qt::Checked;
72 return Qt::Unchecked;
73 }
74
75 if (role == Qt::DisplayRole) {
76 switch(index.column()) {
77 case 0:
78 return QString("");
79 case 1:
80 return QString(lfl.fileList[index.row()].filename.c_str());
81 case 2:
82 return QString(lfl.fileList[index.row()].file.c_str());
83 default:
84 return QString();
85 }
86 }
87 return QVariant();
88}
89
90bool LuaConsoleModel::setData(const QModelIndex &index, const QVariant &value, int role)
91{

Callers

nothing calls this directly

Calls 3

columnMethod · 0.80
activeStateMethod · 0.80
c_strMethod · 0.45

Tested by

no test coverage detected