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

Method data

src/program/ui/RamSearchModel.cpp:65–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63}
64
65QVariant RamSearchModel::data(const QModelIndex &index, int role) const
66{
67 MemValueType new_v;
68 const MemValueType* old_v;
69
70 if (role == Qt::DisplayRole) {
71 switch(index.column()) {
72 case 0:
73 return QString("%1").arg(memscanner.get_address(index.row()), 0, 16);
74 case 1:
75 new_v = memscanner.get_current_value(index.row());
76 return QString(MemValue::to_string(&new_v, value_type, hex));
77 case 2:
78 old_v = memscanner.get_previous_value(index.row());
79 return QString(MemValue::to_string(old_v, value_type, hex));
80 default:
81 return QString();
82 }
83 }
84 if (role == Qt::BackgroundRole) {
85 if (compare_type == CompareType::Previous) {
86 new_v = memscanner.get_current_value(index.row());
87 old_v = memscanner.get_previous_value(index.row());
88 if (!CompareOperations::check_previous(&new_v, old_v))
89 return QBrush(unmatchedColor);
90 }
91 else {
92 new_v = memscanner.get_current_value(index.row());
93 if (!CompareOperations::check_value(&new_v))
94 return QBrush(unmatchedColor);
95 }
96 }
97 return QVariant();
98}
99
100int RamSearchModel::predictScanCount(int mem_flags)
101{

Callers

nothing calls this directly

Calls 4

columnMethod · 0.80
get_addressMethod · 0.80
get_current_valueMethod · 0.80
get_previous_valueMethod · 0.80

Tested by

no test coverage detected