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

Method paint

src/plugins/smartut/common/projectitemdelegate.cpp:42–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40}
41
42void ProjectItemDelegate::paint(QPainter *painter,
43 const QStyleOptionViewItem &option,
44 const QModelIndex &index) const
45{
46 if (!index.isValid())
47 return DStyledItemDelegate::paint(painter, option, index);
48
49 QStyleOptionViewItem opt = option;
50 DStyledItemDelegate::initStyleOption(&opt, index);
51
52 opt.rect.adjust(10, 0, -10, 0);
53 painter->setRenderHint(QPainter::Antialiasing);
54 drawBackground(painter, opt);
55 int depth = itemDepth(index);
56 const auto &iconRect = drawFileIcon(depth, painter, opt, index);
57 drawFileNameItem(painter, opt, index, iconRect);
58}
59
60QSize ProjectItemDelegate::sizeHint(const QStyleOptionViewItem &option,
61 const QModelIndex &index) const

Callers 1

drawItemStateMethod · 0.45

Calls 1

isValidMethod · 0.45

Tested by

no test coverage detected