MCPcopy Create free account
hub / github.com/aldelaro5/dolphin-memory-engine / data

Method data

Source/GUI/StructEditor/StructDetailModel.cpp:33–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31}
32
33QVariant StructDetailModel::data(const QModelIndex& index, int role) const
34{
35 if (!index.isValid())
36 return {};
37
38 if (role == Qt::DisplayRole)
39 {
40 switch (index.column())
41 {
42 case STRUCT_COL_OFFSET:
43 return QString("0x%1").arg(m_fields[index.row()]->getOffset(), 0, 16);
44 case STRUCT_COL_SIZE:
45 return m_fields[index.row()]->getFieldSize();
46 case STRUCT_COL_LABEL:
47 if (m_fields[index.row()]->isPadding())
48 return QString("-- Padding --");
49 return m_fields[index.row()]->getEntry()->getLabel();
50 case STRUCT_COL_TYPE:
51 {
52 return getFieldDetails(m_fields[index.row()]);
53 }
54
55 default:
56 break;
57 }
58 }
59
60 if (role == Qt::EditRole && index.column() == STRUCT_COL_LABEL)
61 if (!m_fields[index.row()]->isPadding())
62 return m_fields[index.row()]->getEntry()->getLabel();
63
64 return {};
65}
66
67bool StructDetailModel::setData(const QModelIndex& index, const QVariant& value, int role)
68{

Callers 1

dropMimeDataMethod · 0.45

Calls 5

getOffsetMethod · 0.80
getFieldSizeMethod · 0.80
isPaddingMethod · 0.80
getLabelMethod · 0.45
getEntryMethod · 0.45

Tested by

no test coverage detected