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

Method sizeHint

src/plugins/recent/mainframe/itemdelegate.cpp:59–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57}
58
59QSize ItemDelegate::sizeHint(const QStyleOptionViewItem &option,
60 const QModelIndex &index) const
61{
62 if (index.isValid()) {
63 QSize size = index.data(Qt::SizeHintRole).toSize();
64 if (size.isValid()) {
65 return size;
66 } else {
67 return { option.rect.width(), option.fontMetrics.height() * 2 + 5 };
68 }
69 }
70 return DStyledItemDelegate::sizeHint(option, index);
71}
72
73void ItemDelegate::paintItemBackground(QPainter *painter, const QStyleOptionViewItem &option,
74 const QModelIndex &index) const

Callers 1

initConnectionMethod · 0.45

Calls 3

widthMethod · 0.80
isValidMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected