MCPcopy Create free account
hub / github.com/CE-Programming/CEmu / paintEvent

Method paintEvent

gui/qt/keypad/keypadwidget.cpp:331–349  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

329}
330
331void KeypadWidget::paintEvent(QPaintEvent *event) {
332 QRegion region{mInverseTransform.map(event->region())};
333 QPainter painter{this};
334 painter.setRenderHint(QPainter::Antialiasing);
335 if (color == KEYPAD_CRYSTALCLEAR) {
336 painter.fillRect(this->rect(), cclrBackground);
337 }
338 painter.setTransform(mTransform);
339 painter.fillPath(keypadPath, mBackground);
340 for (uint8_t row = 0; row != sRows; ++row) {
341 for (uint8_t col = 0; col != sCols; ++col) {
342 if (const Key *key = mKeys[row][col]) {
343 if (region.intersects(key->textGeometry() | key->keyGeometry())) {
344 key->paint(painter);
345 }
346 }
347 }
348 }
349}
350
351void KeypadWidget::changeKeyState(KeyCode code, bool press) {
352 if (Key *key = mKeys[code.row()][code.col()]) {

Callers

nothing calls this directly

Calls 1

paintMethod · 0.45

Tested by

no test coverage detected