MCPcopy Create free account
hub / github.com/OpenBoard-org/OpenBoard / paint

Method paint

src/domain/UBGraphicsItemDelegate.cpp:125–145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123}
124
125void DelegateButton::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
126{
127 painter->save();
128 painter->setCompositionMode(QPainter::CompositionMode_SourceOver);
129 QGraphicsSvgItem::paint(painter, option, widget);
130 painter->restore();
131
132 if (mIsPressed && mShowProgressIndicator) {
133 QPen pen;
134 pen.setBrush(Qt::white);
135 pen.setWidth(3);
136 painter->save();
137 painter->setCompositionMode(QPainter::CompositionMode_SourceOver);
138 painter->setPen(pen);
139
140 int spanAngle = qMin(mPressProgres, UBSettings::longClickInterval) * 360 / UBSettings::longClickInterval;
141 painter->drawArc(option->rect.adjusted(pen.width(), pen.width(), -pen.width(), -pen.width()), 16 * 90, -16 * spanAngle);
142
143 painter->restore();
144 }
145}
146
147void DelegateButton::timerEvent(QTimerEvent *event)
148{

Callers

nothing calls this directly

Calls 5

setWidthMethod · 0.80
drawArcMethod · 0.80
saveMethod · 0.45
widthMethod · 0.45
heightMethod · 0.45

Tested by

no test coverage detected