MCPcopy Create free account
hub / github.com/KangLin/RabbitRemoteControl / data

Method data

App/Client/Recent/RecentModel.cpp:77–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77QVariant CRecentModel::data(const QModelIndex &index, int role) const
78{
79 if (!index.isValid())
80 return QVariant();
81
82 if(index.row() >= m_Items.count())
83 return QVariant();
84
85 auto item = m_Items.at(index.row());
86
87 switch (role) {
88 case Qt::DisplayRole:
89 switch (index.column()) {
90 case Name:
91 return item.szName;
92 case Protocol:
93 return item.szProtocol;
94 case Type:
95 return item.szType;
96 case Time:
97 return item.time.toString(QLocale::system().dateTimeFormat());
98 case ID:
99 return item.szOperateId;
100 case File:
101 return item.GetFile();
102 }
103 break;
104
105 case Qt::DecorationRole:
106 if (index.column() == Name) {
107 return item.icon;
108 }
109 break;
110
111 case Qt::ToolTipRole:
112 return item.szDescription;
113 }
114
115 return QVariant();
116}
117
118bool CRecentModel::removeRows(int row, int count, const QModelIndex &parent)
119{

Callers 14

slotCustomContextMenuMethod · 0.45
slotClickedMethod · 0.45
foreachFunction · 0.45
mainwindow.cppFile · 0.45
foreachFunction · 0.45
slotMenuActivityMethod · 0.45
slotStartMethod · 0.45
slotNewMethod · 0.45
LoadOperateMethod · 0.45
CICEMethod · 0.45
SetDataChannelMethod · 0.45

Calls 2

isValidMethod · 0.80
GetFileMethod · 0.45

Tested by

no test coverage detected