MCPcopy Create free account
hub / github.com/altairwei/WizNotePlus / paintEvent

Method paintEvent

src/WizButton.cpp:28–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26}
27
28void WizButton::paintEvent(QPaintEvent *event)
29{
30 Q_UNUSED(event);
31
32 QStyleOptionToolButton opt;
33 initStyleOption(&opt);
34
35 QPainter p(this);
36
37 QIcon::Mode mode = opt.state & QStyle::State_Enabled ? QIcon::Normal : QIcon::Disabled;
38 if (mode == QIcon::Normal && (opt.state & QStyle::State_HasFocus || opt.state & QStyle::State_Sunken))
39 mode = QIcon::Active;
40 QIcon::State state = QIcon::Off;
41 if (opt.state & QStyle::State_On)
42 state = QIcon::On;
43
44 opt.icon.paint(&p, opt.rect, Qt::AlignCenter, mode, state);
45}

Callers

nothing calls this directly

Calls 1

paintMethod · 0.45

Tested by

no test coverage detected