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

Method data

src/program/ui/PointerScanModel.cpp:271–291  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

269}
270
271QVariant PointerScanModel::data(const QModelIndex &index, int role) const
272{
273 if (role == Qt::DisplayRole) {
274 const std::pair<uintptr_t, std::vector<int>> &chain = pointer_chains.at(index.row());
275 if (index.column() == 0) {
276 /* Get file and offset */
277 off_t offset;
278 std::string file = BaseAddresses::getFileAndOffset(chain.first, offset);
279 if (offset >= 0)
280 return QString("%1+0x%2").arg(file.c_str()).arg(offset, 0, 16);
281 else
282 return QString("%1-0x%2").arg(file.c_str()).arg(-offset, 0, 16);
283 }
284 if (index.column() > static_cast<int>(chain.second.size())) {
285 return QString("");
286 }
287 /* Offsets are stored in reverse order */
288 return QString("%1").arg(*(chain.second.rbegin() + (index.column() - 1)), 0, 16);
289 }
290 return QVariant();
291}

Callers 2

saveChainsMethod · 0.45
loadChainsMethod · 0.45

Calls 5

columnMethod · 0.80
rbeginMethod · 0.80
atMethod · 0.45
c_strMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected