MailJDTourDownloadDocsQualityTestsCoverage

Which source lines and branches the tests execute. Lines 91.5 %, branches 75.0 % (minimum 85 % and 72 %). main @ 399ffe3d · 21 October 2026 · pipeline 7238.

GCC Code Coverage Report


Directory: src/
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 86.0% 37 / 0 / 43
Functions: 100.0% 6 / 0 / 6
Branches: 88.9% 32 / 0 / 36

presentation/KeyOverlayScrim.cpp
Line Branch Exec Source
1 #include "KeyOverlayScrim.h"
2
3 #include <QPainter>
4 #include <QPainterPath>
5
6 831 KeyOverlayScrim::KeyOverlayScrim(QQuickItem *parent) : QQuickPaintedItem(parent) {
7
1/1
✓ Branch 5 → 6 taken 831 times.
831 setAntialiasing(true);
8
1/1
✓ Branch 7 → 8 taken 831 times.
831 setAcceptedMouseButtons(Qt::NoButton);
9 831 }
10
11 1141 void KeyOverlayScrim::setColor(const QColor &color) {
12
2/2
✓ Branch 3 → 4 taken 243 times.
✓ Branch 3 → 5 taken 898 times.
1141 if (m_color == color) return;
13 898 m_color = color;
14
1/1
✓ Branch 6 → 7 taken 898 times.
898 update();
15 898 emit changed();
16 }
17
18 903 void KeyOverlayScrim::setHoles(const QVariantList &holes) {
19
2/2
✓ Branch 3 → 4 taken 832 times.
✓ Branch 3 → 5 taken 71 times.
903 if (m_holes == holes) return;
20 71 m_holes = holes;
21
1/1
✓ Branch 7 → 8 taken 71 times.
71 update();
22 71 emit changed();
23 }
24
25 831 void KeyOverlayScrim::setRadius(qreal radius) {
26
1/2
✓ Branch 3 → 4 taken 831 times.
✗ Branch 3 → 5 not taken.
831 if (qFuzzyCompare(m_radius, radius)) return;
27 ✗ m_radius = radius;
28 ✗ update();
29 ✗ emit changed();
30 }
31
32 831 void KeyOverlayScrim::setFeather(qreal feather) {
33
1/2
✓ Branch 3 → 4 taken 831 times.
✗ Branch 3 → 5 not taken.
831 if (qFuzzyCompare(m_feather, feather)) return;
34 ✗ m_feather = feather;
35 ✗ update();
36 ✗ emit changed();
37 }
38
39 1123 void KeyOverlayScrim::paint(QPainter *painter) {
40 1123 painter->setRenderHint(QPainter::Antialiasing);
41
3/3
✓ Branch 3 → 4 taken 1123 times.
✓ Branch 4 → 5 taken 1123 times.
✓ Branch 6 → 7 taken 1123 times.
1123 painter->fillRect(QRectF(0, 0, width(), height()), m_color);
42 1123 painter->setCompositionMode(QPainter::CompositionMode_DestinationOut);
43 1123 painter->setPen(Qt::NoPen);
44 // The soft edge: rings from the outer feather edge inwards, each removing
45 // a share of the scrim, then the hole itself fully cleared.
46 1123 constexpr int steps = 6;
47
2/2
✓ Branch 69 → 12 taken 76 times.
✓ Branch 69 → 70 taken 1123 times.
1199 for (const QVariant &value : std::as_const(m_holes)) {
48
1/1
✓ Branch 13 → 14 taken 76 times.
76 const QVariantMap hole = value.toMap();
49
2/2
✓ Branch 30 → 31 taken 76 times.
✓ Branch 36 → 37 taken 76 times.
228 const QRectF rect(hole.value(QStringLiteral("x")).toReal(), hole.value(QStringLiteral("y")).toReal(),
50
6/6
✓ Branch 18 → 19 taken 76 times.
✓ Branch 19 → 20 taken 76 times.
✓ Branch 24 → 25 taken 76 times.
✓ Branch 25 → 26 taken 76 times.
✓ Branch 31 → 32 taken 76 times.
✓ Branch 37 → 38 taken 76 times.
456 hole.value(QStringLiteral("width")).toReal(), hole.value(QStringLiteral("height")).toReal());
51 // DestinationOut uses only the source alpha: an opaque brush at a
52 // painter opacity removes that share of the scrim.
53
2/2
✓ Branch 55 → 56 taken 76 times.
✓ Branch 56 → 57 taken 76 times.
76 painter->setBrush(Qt::black);
54
1/1
✓ Branch 58 → 59 taken 76 times.
76 painter->setOpacity(1.0 / (steps + 1));
55
2/2
✓ Branch 63 → 60 taken 456 times.
✓ Branch 63 → 64 taken 76 times.
532 for (int step = steps; step >= 1; --step) {
56 456 const qreal grow = m_feather * step / steps;
57
1/1
✓ Branch 61 → 62 taken 456 times.
456 painter->drawRoundedRect(rect.adjusted(-grow, -grow, grow, grow), m_radius + grow, m_radius + grow);
58 }
59
1/1
✓ Branch 64 → 65 taken 76 times.
76 painter->setOpacity(1.0);
60
1/1
✓ Branch 65 → 66 taken 76 times.
76 painter->drawRoundedRect(rect, m_radius, m_radius);
61 76 }
62 1123 }
63