Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/items/qquicktextutil_p.h |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||
2 | - | |||||||||||||
3 | - | |||||||||||||
4 | class QQuickTextUtil : public QObject | - | ||||||||||||
5 | { | - | ||||||||||||
6 | public: | - | ||||||||||||
7 | #pragma GCC diagnostic push | - | ||||||||||||
8 | - | |||||||||||||
9 | #pragma GCC diagnostic ignored "-Wsuggest-override" | - | ||||||||||||
10 | static const QMetaObject staticMetaObject; virtual const QMetaObject *metaObject() const; virtual void *qt_metacast(const char *); virtual int qt_metacall(QMetaObject::Call, int, void **); static inline QString tr(const char *s, const char *c = nullptr, int n = -1) { return staticMetaObject.tr(s, c, n); } __attribute__ ((__deprecated__)) static inline QString trUtf8(const char *s, const char *c = nullptr, int n = -1) { return staticMetaObject.tr(s, c, n); } private: | - | ||||||||||||
11 | #pragma GCC diagnostic ignored "-Wattributes" | - | ||||||||||||
12 | __attribute__((visibility("hidden"))) static void qt_static_metacall(QObject *, QMetaObject::Call, int, void **); | - | ||||||||||||
13 | #pragma GCC diagnostic pop | - | ||||||||||||
14 | struct QPrivateSignal {}; | - | ||||||||||||
15 | public: | - | ||||||||||||
16 | template <typename Private> static void setCursorDelegate(Private *d, QQmlComponent *delegate); | - | ||||||||||||
17 | template <typename Private> static void createCursor(Private *d); | - | ||||||||||||
18 | - | |||||||||||||
19 | template <typename T> static typename T::RenderType textRenderType(); | - | ||||||||||||
20 | - | |||||||||||||
21 | static qreal alignedX(qreal textWidth, qreal itemWidth, int alignment); | - | ||||||||||||
22 | static qreal alignedY(qreal textHeight, qreal itemHeight, int alignment); | - | ||||||||||||
23 | - | |||||||||||||
24 | private: | - | ||||||||||||
25 | static QQuickItem *createCursor( | - | ||||||||||||
26 | QQmlComponent *component, | - | ||||||||||||
27 | QQuickItem *parent, | - | ||||||||||||
28 | const QRectF &cursorRectangle, | - | ||||||||||||
29 | const char *className); | - | ||||||||||||
30 | - | |||||||||||||
31 | }; | - | ||||||||||||
32 | - | |||||||||||||
33 | template <typename Private> | - | ||||||||||||
34 | void QQuickTextUtil::setCursorDelegate(Private *d, QQmlComponent *delegate) | - | ||||||||||||
35 | { | - | ||||||||||||
36 | if (d->cursorComponent == delegate
| 0-60 | ||||||||||||
37 | return; never executed: return; | 0 | ||||||||||||
38 | - | |||||||||||||
39 | typename Private::Public *parent = d->q_func(); | - | ||||||||||||
40 | - | |||||||||||||
41 | if (d->cursorComponent
| 14-46 | ||||||||||||
42 | disconnect(d->cursorComponent, qFlagLocation("2""statusChanged(QQmlComponent::Status)" "\0" __FILE__ ":" "91"), | - | ||||||||||||
43 | parent, qFlagLocation("1""createCursor()" "\0" __FILE__ ":" "92")); | - | ||||||||||||
44 | } executed 14 times by 2 tests: end of block Executed by:
| 14 | ||||||||||||
45 | - | |||||||||||||
46 | delete d->cursorItem; | - | ||||||||||||
47 | d->cursorItem = 0; | - | ||||||||||||
48 | d->cursorPending = true; | - | ||||||||||||
49 | - | |||||||||||||
50 | d->cursorComponent = delegate; | - | ||||||||||||
51 | - | |||||||||||||
52 | if (parent->isCursorVisible()
| 4-42 | ||||||||||||
53 | createCursor(d); executed 14 times by 2 tests: createCursor(d); Executed by:
| 14 | ||||||||||||
54 | - | |||||||||||||
55 | parent->cursorDelegateChanged(); | - | ||||||||||||
56 | } executed 60 times by 2 tests: end of block Executed by:
| 60 | ||||||||||||
57 | - | |||||||||||||
58 | template <typename Private> | - | ||||||||||||
59 | void QQuickTextUtil::createCursor(Private *d) | - | ||||||||||||
60 | { | - | ||||||||||||
61 | if (!d->cursorPending
| 64-686 | ||||||||||||
62 | return; executed 686 times by 5 tests: return; Executed by:
| 686 | ||||||||||||
63 | - | |||||||||||||
64 | d->cursorPending = false; | - | ||||||||||||
65 | - | |||||||||||||
66 | typename Private::Public *parent = d->q_func(); | - | ||||||||||||
67 | if (d->cursorComponent
| 14-50 | ||||||||||||
68 | d->cursorItem = createCursor( | - | ||||||||||||
69 | d->cursorComponent, | - | ||||||||||||
70 | parent, | - | ||||||||||||
71 | parent->cursorRectangle(), | - | ||||||||||||
72 | Private::Public::staticMetaObject.className()); | - | ||||||||||||
73 | } executed 50 times by 2 tests: end of block Executed by:
| 50 | ||||||||||||
74 | - | |||||||||||||
75 | d->setNativeCursorEnabled(!d->cursorItem); | - | ||||||||||||
76 | d->updateType = Private::UpdatePaintNode; | - | ||||||||||||
77 | parent->update(); | - | ||||||||||||
78 | } executed 64 times by 2 tests: end of block Executed by:
| 64 | ||||||||||||
79 | - | |||||||||||||
80 | template <typename T> | - | ||||||||||||
81 | typename T::RenderType QQuickTextUtil::textRenderType() | - | ||||||||||||
82 | { | - | ||||||||||||
83 | switch (QQuickWindow::textRenderType()) { | - | ||||||||||||
84 | case executed 266796 times by 39 tests: QQuickWindow::QtTextRendering:case QQuickWindow::QtTextRendering: Executed by:
executed 266796 times by 39 tests: case QQuickWindow::QtTextRendering: Executed by:
| 266796 | ||||||||||||
85 | return executed 266796 times by 39 tests: T::QtRendering;return T::QtRendering; Executed by:
executed 266796 times by 39 tests: return T::QtRendering; Executed by:
| 266796 | ||||||||||||
86 | case never executed: QQuickWindow::NativeTextRendering:case QQuickWindow::NativeTextRendering: never executed: case QQuickWindow::NativeTextRendering: | 0 | ||||||||||||
87 | return never executed: T::NativeRendering;return T::NativeRendering; never executed: return T::NativeRendering; | 0 | ||||||||||||
88 | } | - | ||||||||||||
89 | - | |||||||||||||
90 | do { ((false) ? static_cast<void>(0) : qt_assert_x("Q_UNREACHABLE()", "Q_UNREACHABLE was reached", __FILE__, 139)); __builtin_unreachable(); } while (false); | - | ||||||||||||
91 | return never executed: T::QtRendering;return T::QtRendering; never executed: return T::QtRendering; | 0 | ||||||||||||
92 | } | - | ||||||||||||
93 | - | |||||||||||||
94 | - | |||||||||||||
Switch to Source code | Preprocessed file |