MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / data

Method data

examples/triage/imports.cpp:53–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51
52
53QVariant GenericImportsModel::data(const QModelIndex& index, int role) const
54{
55 switch (role)
56 {
57 case Qt::DisplayRole:
58 if (!index.isValid() || index.row() >= (int)m_entries.size())
59 return QVariant();
60 if (index.column() == 0)
61 return QString("0x") + QString::number(m_entries[index.row()]->GetAddress(), 16);
62 if (index.column() == m_nameCol)
63 return QString::fromStdString(m_entries[index.row()]->GetFullName());
64 if (index.column() == m_moduleCol)
65 return getNamespace(m_entries[index.row()]);
66 if (index.column() == m_ordinalCol)
67 return QString::number(m_entries[index.row()]->GetOrdinal());
68 if (index.column() == m_typeLibCol)
69 return getLibrarySource(m_entries[index.row()]);
70 break;
71 case Qt::ForegroundRole:
72 if (index.column() == 0)
73 return getThemeColor(AddressColor);
74 if (index.column() == m_nameCol)
75 return getThemeColor(ImportColor);
76 break;
77 default:
78 break;
79 }
80
81 return QVariant();
82}
83
84
85QVariant GenericImportsModel::headerData(int section, Qt::Orientation orientation, int role) const

Callers

nothing calls this directly

Calls 4

GetFullNameMethod · 0.80
GetOrdinalMethod · 0.80
sizeMethod · 0.45
GetAddressMethod · 0.45

Tested by

no test coverage detected