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

Method data

src/program/ui/RamWatchModel.cpp:74–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72}
73
74QVariant RamWatchModel::data(const QModelIndex &index, int role) const
75{
76 const std::unique_ptr<RamWatchDetailed> &watch = ramwatches.at(index.row());
77 if (role == Qt::DisplayRole || role == Qt::EditRole) {
78 switch(index.column()) {
79 case 0:
80 if (watch->is_pointer)
81 return QString("P->%1").arg(watch->address, 0, 16);
82 else
83 return QString("%1").arg(watch->address, 0, 16);
84 case 1:
85 return QString(watch->value_str());
86 case 2:
87 return QString(watch->label.c_str());
88 default:
89 return QString();
90 }
91 }
92 if (role == Qt::ForegroundRole) {
93 if (index.column() == 1) {
94 if (watch->is_frozen) {
95 return QBrush(QColorConstants::Red);
96 }
97 }
98 return QGuiApplication::palette().text();
99 }
100 return QVariant();
101}
102
103bool RamWatchModel::setData(const QModelIndex &index, const QVariant &value, int role)
104{

Callers 1

dropMimeDataMethod · 0.45

Calls 5

columnMethod · 0.80
value_strMethod · 0.80
textMethod · 0.80
atMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected