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

Method actionInfoList

src/plugins/core/notify/gui/itemdelegate.cpp:298–324  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

296}
297
298QList<ActionBtuuonInfo> ItemDelegate::actionInfoList(const QStyleOptionViewItem &option, const QModelIndex &index) const
299{
300 auto actList = index.data(kActionsRole).toStringList();
301 if (actList.isEmpty())
302 return {};
303
304 QList<ActionBtuuonInfo> actInfoList;
305 ActionBtuuonInfo info;
306 QRect tmpRect = option.rect;
307 for (int i = actList.size() - 1; i >= 0; --i) {
308 if (i % 2 == 0) {
309 info.id = actList[i];
310 actInfoList.append(info);
311 } else {
312 info.text = actList[i];
313 info.rect = tmpRect;
314 auto textRect = option.fontMetrics.boundingRect(0, 0, tmpRect.width(), 0, Qt::TextSingleLine, info.text);
315 textRect.adjust(-15, -5, 15, 5);
316 info.rect.setSize(textRect.size());
317 info.rect.moveRight(tmpRect.right() - kNotificationSpacing);
318 info.rect.moveBottom(option.rect.bottom() - kNotificationSpacing);
319 tmpRect.moveRight(info.rect.left());
320 }
321 }
322
323 return actInfoList;
324}
325
326QRect ItemDelegate::closeButtonRect(const QRect &itemRect) const
327{

Callers

nothing calls this directly

Calls 9

widthMethod · 0.80
rightMethod · 0.80
bottomMethod · 0.80
leftMethod · 0.80
dataMethod · 0.45
isEmptyMethod · 0.45
sizeMethod · 0.45
appendMethod · 0.45
setSizeMethod · 0.45

Tested by

no test coverage detected