Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/items/qquickpositioners_p_p.h |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||
---|---|---|---|---|---|---|---|---|
1 | - | |||||||
2 | static_assert(bool(1 == 1), "Required feature " "quick_positioners" " for file " __FILE__ " not available."); | - | ||||||
3 | - | |||||||
4 | - | |||||||
5 | - | |||||||
6 | - | |||||||
7 | - | |||||||
8 | - | |||||||
9 | - | |||||||
10 | class QQuickItemViewTransitioner; | - | ||||||
11 | - | |||||||
12 | class QQuickBasePositionerPrivate : public QQuickImplicitSizeItemPrivate, public QQuickItemChangeListener | - | ||||||
13 | { | - | ||||||
14 | inline QQuickBasePositioner* q_func() { return static_cast<QQuickBasePositioner *>(q_ptr); } inline const QQuickBasePositioner* q_func() const { return static_cast<const QQuickBasePositioner *>(q_ptr); } friend class QQuickBasePositioner; | - | ||||||
15 | - | |||||||
16 | public: | - | ||||||
17 | struct ExtraData { | - | ||||||
18 | ExtraData(); | - | ||||||
19 | - | |||||||
20 | qreal padding; | - | ||||||
21 | qreal topPadding; | - | ||||||
22 | qreal leftPadding; | - | ||||||
23 | qreal rightPadding; | - | ||||||
24 | qreal bottomPadding; | - | ||||||
25 | bool explicitTopPadding : 1; | - | ||||||
26 | bool explicitLeftPadding : 1; | - | ||||||
27 | bool explicitRightPadding : 1; | - | ||||||
28 | bool explicitBottomPadding : 1; | - | ||||||
29 | }; | - | ||||||
30 | QLazilyAllocated<ExtraData> extra; | - | ||||||
31 | - | |||||||
32 | QQuickBasePositionerPrivate() | - | ||||||
33 | : spacing(0), type(QQuickBasePositioner::None) | - | ||||||
34 | , transitioner(0), positioningDirty(false) | - | ||||||
35 | , doingPositioning(false), anchorConflict(false), layoutDirection(Qt::LeftToRight) | - | ||||||
36 | - | |||||||
37 | { | - | ||||||
38 | } executed 12396 times by 23 tests: end of block Executed by:
| 12396 | ||||||
39 | - | |||||||
40 | void init(QQuickBasePositioner::PositionerType at) | - | ||||||
41 | { | - | ||||||
42 | type = at; | - | ||||||
43 | } executed 12396 times by 23 tests: end of block Executed by:
| 12396 | ||||||
44 | - | |||||||
45 | qreal spacing; | - | ||||||
46 | - | |||||||
47 | QQuickBasePositioner::PositionerType type; | - | ||||||
48 | QQuickItemViewTransitioner *transitioner; | - | ||||||
49 | - | |||||||
50 | void watchChanges(QQuickItem *other); | - | ||||||
51 | void unwatchChanges(QQuickItem* other); | - | ||||||
52 | void setPositioningDirty() { | - | ||||||
53 | QQuickBasePositioner * const q = q_func(); | - | ||||||
54 | if (!positioningDirty
| 42608-51391 | ||||||
55 | positioningDirty = true; | - | ||||||
56 | q->polish(); | - | ||||||
57 | } executed 42608 times by 23 tests: end of block Executed by:
| 42608 | ||||||
58 | } executed 93999 times by 23 tests: end of block Executed by:
| 93999 | ||||||
59 | - | |||||||
60 | bool positioningDirty : 1; | - | ||||||
61 | bool doingPositioning : 1; | - | ||||||
62 | bool anchorConflict : 1; | - | ||||||
63 | - | |||||||
64 | Qt::LayoutDirection layoutDirection; | - | ||||||
65 | - | |||||||
66 | void mirrorChange() override { | - | ||||||
67 | effectiveLayoutDirectionChange(); | - | ||||||
68 | } executed 18 times by 2 tests: end of block Executed by:
| 18 | ||||||
69 | bool isLeftToRight() const { | - | ||||||
70 | if (type == QQuickBasePositioner::Vertical
| 0-17426 | ||||||
71 | return never executed: true;return true; never executed: return true; | 0 | ||||||
72 | else | - | ||||||
73 | return executed 17426 times by 15 tests: effectiveLayoutMirror ? layoutDirection == Qt::RightToLeft : layoutDirection == Qt::LeftToRight;return effectiveLayoutMirror ? layoutDirection == Qt::RightToLeft : layoutDirection == Qt::LeftToRight; Executed by:
executed 17426 times by 15 tests: return effectiveLayoutMirror ? layoutDirection == Qt::RightToLeft : layoutDirection == Qt::LeftToRight; Executed by:
| 17426 | ||||||
74 | } | - | ||||||
75 | - | |||||||
76 | void itemSiblingOrderChanged(QQuickItem* other) override | - | ||||||
77 | { | - | ||||||
78 | (void)other;; | - | ||||||
79 | setPositioningDirty(); | - | ||||||
80 | } executed 2922 times by 2 tests: end of block Executed by:
| 2922 | ||||||
81 | - | |||||||
82 | void itemGeometryChanged(QQuickItem *, QQuickGeometryChange change, const QRectF &) override | - | ||||||
83 | { | - | ||||||
84 | if (change.sizeChange()
| 48187-81357 | ||||||
85 | setPositioningDirty(); executed 48187 times by 8 tests: setPositioningDirty(); Executed by:
| 48187 | ||||||
86 | } executed 129544 times by 20 tests: end of block Executed by:
| 129544 | ||||||
87 | - | |||||||
88 | void itemVisibilityChanged(QQuickItem *) override | - | ||||||
89 | { | - | ||||||
90 | setPositioningDirty(); | - | ||||||
91 | } executed 108 times by 6 tests: end of block Executed by:
| 108 | ||||||
92 | - | |||||||
93 | void itemDestroyed(QQuickItem *item) override | - | ||||||
94 | { | - | ||||||
95 | QQuickBasePositioner * const q = q_func(); | - | ||||||
96 | int index = q->positionedItems.find(QQuickBasePositioner::PositionedItem(item)); | - | ||||||
97 | if (index >= 0
| 0 | ||||||
98 | q->removePositionedItem(&q->positionedItems, index); never executed: q->removePositionedItem(&q->positionedItems, index); | 0 | ||||||
99 | } never executed: end of block | 0 | ||||||
100 | - | |||||||
101 | static Qt::LayoutDirection getLayoutDirection(const QQuickBasePositioner *positioner) | - | ||||||
102 | { | - | ||||||
103 | return executed 2 times by 1 test: positioner->d_func()->layoutDirection;return positioner->d_func()->layoutDirection; Executed by:
executed 2 times by 1 test: return positioner->d_func()->layoutDirection; Executed by:
| 2 | ||||||
104 | } | - | ||||||
105 | - | |||||||
106 | static Qt::LayoutDirection getEffectiveLayoutDirection(const QQuickBasePositioner *positioner) | - | ||||||
107 | { | - | ||||||
108 | if (positioner->d_func()->effectiveLayoutMirror
| 170-3630 | ||||||
109 | return executed 170 times by 2 tests: positioner->d_func()->layoutDirection == Qt::RightToLeft ? Qt::LeftToRight : Qt::RightToLeft;return positioner->d_func()->layoutDirection == Qt::RightToLeft ? Qt::LeftToRight : Qt::RightToLeft; Executed by:
executed 170 times by 2 tests: return positioner->d_func()->layoutDirection == Qt::RightToLeft ? Qt::LeftToRight : Qt::RightToLeft; Executed by:
| 170 | ||||||
110 | else | - | ||||||
111 | return executed 3630 times by 7 tests: positioner->d_func()->layoutDirection;return positioner->d_func()->layoutDirection; Executed by:
executed 3630 times by 7 tests: return positioner->d_func()->layoutDirection; Executed by:
| 3630 | ||||||
112 | } | - | ||||||
113 | - | |||||||
114 | virtual void effectiveLayoutDirectionChange() | - | ||||||
115 | { | - | ||||||
116 | } | - | ||||||
117 | - | |||||||
118 | inline qreal padding() const { return executed 774374 times by 23 tests: extra.isAllocated() ? extra->padding : 0.0;return extra.isAllocated() ? extra->padding : 0.0; Executed by:
executed 774374 times by 23 tests: }return extra.isAllocated() ? extra->padding : 0.0; Executed by:
| 774374 | ||||||
119 | void setTopPadding(qreal value, bool reset = false); | - | ||||||
120 | void setLeftPadding(qreal value, bool reset = false); | - | ||||||
121 | void setRightPadding(qreal value, bool reset = false); | - | ||||||
122 | void setBottomPadding(qreal value, bool reset = false); | - | ||||||
123 | }; | - | ||||||
124 | - | |||||||
125 | - | |||||||
Switch to Source code | Preprocessed file |