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

Method data

Source/GUI/StructEditor/StructSelectModel.cpp:42–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40}
41
42QVariant StructSelectModel::data(const QModelIndex& index, int role) const
43{
44 if (!index.isValid())
45 return {};
46
47 StructTreeNode* item = static_cast<StructTreeNode*>(index.internalPointer());
48
49 if (!item->isGroup())
50 {
51 if (role == Qt::DisplayRole || role == Qt::EditRole)
52 {
53 switch (index.column())
54 {
55 case WATCH_COL_LABEL:
56 {
57 return item->getName();
58 }
59 default:
60 break;
61 }
62 }
63 }
64 else
65 {
66 if (index.column() == WATCH_COL_LABEL && (role == Qt::DisplayRole || role == Qt::EditRole))
67 return item->getName();
68 if (index.column() == WATCH_COL_LABEL && role == Qt::DecorationRole)
69 {
70 static const QIcon s_folderIcon(":/folder.svg");
71 static const QIcon s_emptyFolderIcon(":/folder_empty.svg");
72 return item->hasChildren() ? s_folderIcon : s_emptyFolderIcon;
73 }
74 }
75 return {};
76}
77
78QModelIndex StructSelectModel::index(int row, int column, const QModelIndex& parent) const
79{

Callers 1

dropMimeDataMethod · 0.45

Calls 2

isGroupMethod · 0.45
hasChildrenMethod · 0.45

Tested by

no test coverage detected