Line | Source Code | Coverage |
---|
1 | | - |
2 | | - |
3 | | - |
4 | | - |
5 | | - |
6 | | - |
7 | | - |
8 | | - |
9 | | - |
10 | | - |
11 | | - |
12 | QCursorData::QCursorData(Qt::CursorShape s) | - |
13 | : ref(1), cshape(s), bm(0), bmm(0), hx(0), hy(0) | - |
14 | { | - |
15 | } executed: } Execution Count:6430 | 6430 |
16 | | - |
17 | QCursorData::~QCursorData() | - |
18 | { | - |
19 | delete bm; | - |
20 | delete bmm; | - |
21 | } executed: } Execution Count:6367 | 6367 |
22 | | - |
23 | | - |
24 | | - |
25 | | - |
26 | | - |
27 | | - |
28 | extern QCursorData *qt_cursorTable[Qt::LastCursor + 1]; | - |
29 | | - |
30 | QCursorData *QCursorData::setBitmap(const QBitmap &bitmap, const QBitmap &mask, int hotX, int hotY) | - |
31 | { | - |
32 | if (!QCursorData::initialized) partially evaluated: !QCursorData::initialized no Evaluation Count:0 | yes Evaluation Count:72 |
| 0-72 |
33 | QCursorData::initialize(); never executed: QCursorData::initialize(); | 0 |
34 | if (bitmap.depth() != 1 || mask.depth() != 1 || bitmap.size() != mask.size()) { partially evaluated: bitmap.depth() != 1 no Evaluation Count:0 | yes Evaluation Count:72 |
partially evaluated: mask.depth() != 1 no Evaluation Count:0 | yes Evaluation Count:72 |
partially evaluated: bitmap.size() != mask.size() no Evaluation Count:0 | yes Evaluation Count:72 |
| 0-72 |
35 | QMessageLogger("kernel/qcursor_qpa.cpp", 82, __PRETTY_FUNCTION__).warning("QCursor: Cannot create bitmap cursor; invalid bitmap(s)"); | - |
36 | QCursorData *c = qt_cursorTable[0]; | - |
37 | c->ref.ref(); | - |
38 | return c; never executed: return c; | 0 |
39 | } | - |
40 | QCursorData *d = new QCursorData; | - |
41 | d->bm = new QBitmap(bitmap); | - |
42 | d->bmm = new QBitmap(mask); | - |
43 | d->cshape = Qt::BitmapCursor; | - |
44 | d->hx = hotX >= 0 ? hotX : bitmap.width() / 2; evaluated: hotX >= 0 yes Evaluation Count:60 | yes Evaluation Count:12 |
| 12-60 |
45 | d->hy = hotY >= 0 ? hotY : bitmap.height() / 2; evaluated: hotY >= 0 yes Evaluation Count:60 | yes Evaluation Count:12 |
| 12-60 |
46 | | - |
47 | return d; executed: return d; Execution Count:72 | 72 |
48 | } | - |
49 | | - |
50 | void QCursorData::update() | - |
51 | { | - |
52 | } | - |
53 | | - |
54 | | - |
55 | | - |
56 | QPoint QCursor::pos() | - |
57 | { | - |
58 | return QCursor::pos(QGuiApplication::primaryScreen()); executed: return QCursor::pos(QGuiApplication::primaryScreen()); Execution Count:18996 | 18996 |
59 | } | - |
60 | | - |
61 | QPoint QCursor::pos(const QScreen *screen) | - |
62 | { | - |
63 | if (screen) partially evaluated: screen yes Evaluation Count:18996 | no Evaluation Count:0 |
| 0-18996 |
64 | if (const QPlatformCursor *cursor = screen->handle()->cursor()) partially evaluated: const QPlatformCursor *cursor = screen->handle()->cursor() yes Evaluation Count:18996 | no Evaluation Count:0 |
| 0-18996 |
65 | return cursor->pos(); executed: return cursor->pos(); Execution Count:18996 | 18996 |
66 | return QGuiApplicationPrivate::lastCursorPosition.toPoint(); never executed: return QGuiApplicationPrivate::lastCursorPosition.toPoint(); | 0 |
67 | } | - |
68 | | - |
69 | void QCursor::setPos(QScreen *screen, int x, int y) | - |
70 | { | - |
71 | if (screen) { partially evaluated: screen yes Evaluation Count:442 | no Evaluation Count:0 |
| 0-442 |
72 | if (QPlatformCursor *cursor = screen->handle()->cursor()) { partially evaluated: QPlatformCursor *cursor = screen->handle()->cursor() yes Evaluation Count:442 | no Evaluation Count:0 |
| 0-442 |
73 | const QPoint pos = QPoint(x, y); | - |
74 | | - |
75 | | - |
76 | | - |
77 | if (pos != cursor->pos()) evaluated: pos != cursor->pos() yes Evaluation Count:432 | yes Evaluation Count:10 |
| 10-432 |
78 | cursor->setPos(pos); executed: cursor->setPos(pos); Execution Count:432 | 432 |
79 | } executed: } Execution Count:442 | 442 |
80 | } executed: } Execution Count:442 | 442 |
81 | } executed: } Execution Count:442 | 442 |
82 | | - |
83 | void QCursor::setPos(int x, int y) | - |
84 | { | - |
85 | QCursor::setPos(QGuiApplication::primaryScreen(), x, y); | - |
86 | } executed: } Execution Count:442 | 442 |
87 | | - |
88 | | - |
89 | | - |
| | |