MCPcopy Create free account
hub / github.com/YACReader/yacreader / paintEvent

Method paintEvent

custom_widgets/yacreader_busy_widget.cpp:158–182  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

156}
157
158void BusyIndicator::paintEvent(QPaintEvent *)
159{
160 QString key = QString("%1:%2:%3:%4:%5")
161 .arg(metaObject()->className())
162 .arg(width())
163 .arg(height())
164 .arg(startAngle)
165 .arg(m_style);
166
167 QPixmap pixmap;
168 pixmap.setDevicePixelRatio(devicePixelRatioF());
169 QPainter painter(this);
170 painter.setRenderHint(QPainter::Antialiasing);
171
172 int side = qMin(width(), height());
173
174 if (!QPixmapCache::find(key, &pixmap)) {
175 pixmap = generatePixmap(side * devicePixelRatioF());
176 QPixmapCache::insert(key, pixmap);
177 }
178
179 painter.translate(width() / 2 - side / 2, height() / 2 - side / 2);
180
181 painter.drawPixmap(0, 0, side, side, pixmap);
182}
183
184QSize BusyIndicator::minimumSizeHint() const
185{

Callers

nothing calls this directly

Calls 2

translateMethod · 0.80
QStringClass · 0.50

Tested by

no test coverage detected