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

Method paint

src/plugins/project/mainframe/projectdelegate.cpp:48–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46}
47
48void ProjectDelegate::paint(QPainter *painter,
49 const QStyleOptionViewItem &option,
50 const QModelIndex &index) const
51{
52 QStyleOptionViewItem iOption = option;
53 if (d->index.isValid() && d->index == index) {
54 iOption.font.setBold(true);
55 d->spinner->move(option.rect.right() - 20, option.rect.top() + 4);
56
57 if (index.data(Project::ParsingStateRole).value<Project::ParsingState>() == Project::Wait && !d->spinner->isVisible()) {
58 d->spinner->show();
59 d->spinner->start();
60 } else if (index.data(Project::ParsingStateRole).value<Project::ParsingState>() == Project::Done) {
61 d->spinner->hide();
62 d->spinner->stop();
63 }
64 }
65
66 BaseItemDelegate::paint(painter, iOption, index);
67}
68
69QSize ProjectDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
70{

Callers

nothing calls this directly

Calls 9

rightMethod · 0.80
topMethod · 0.80
isVisibleMethod · 0.80
isValidMethod · 0.45
dataMethod · 0.45
showMethod · 0.45
startMethod · 0.45
hideMethod · 0.45
stopMethod · 0.45

Tested by

no test coverage detected