| 51 | |
| 52 | |
| 53 | QVariant 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 | |
| 85 | QVariant GenericImportsModel::headerData(int section, Qt::Orientation orientation, int role) const |
nothing calls this directly
no test coverage detected