MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / data

Method data

src/plugins/chat/widgets/referencepopup.cpp:136–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

134}
135
136QVariant ItemModel::data(const QModelIndex &index, int role) const
137{
138 if (!index.isValid() || index.row() >= displayItems.size())
139 return QVariant();
140
141 switch (role) {
142 case Qt::DisplayRole:
143 if (index.column() == DisplayNameColumn)
144 return displayItems.at(index.row()).displayName;
145 else if (index.column() == ExtraInfoColumn)
146 return displayItems.at(index.row()).extraInfo;
147 break;
148 case Qt::ToolTipRole:
149 if (!displayItems.at(index.row()).extraInfo.isEmpty())
150 return displayItems.at(index.row()).extraInfo;
151 case Qt::DecorationRole:
152 if (index.column() == DisplayNameColumn)
153 return displayItems[index.row()].icon;
154 break;
155 };
156 return QVariant();
157}
158
159void ItemModel::addItems(const QList<ItemInfo> &items)
160{

Callers 3

eventProcessMethod · 0.45
showChunksReferencesMethod · 0.45
sizeHintMethod · 0.45

Calls 6

rowMethod · 0.80
columnMethod · 0.80
atMethod · 0.80
isValidMethod · 0.45
sizeMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected