Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/items/qquickpathview_p_p.h |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||||||||
2 | static_assert(bool(1 == 1), "Required feature " "quick_pathview" " for file " __FILE__ " not available."); | - | ||||||||||||||||||
3 | - | |||||||||||||||||||
4 | - | |||||||||||||||||||
5 | - | |||||||||||||||||||
6 | - | |||||||||||||||||||
7 | - | |||||||||||||||||||
8 | - | |||||||||||||||||||
9 | - | |||||||||||||||||||
10 | class QQmlOpenMetaObjectType; | - | ||||||||||||||||||
11 | class QQuickPathViewAttached; | - | ||||||||||||||||||
12 | class QQuickPathViewPrivate : public QQuickItemPrivate, public QQuickItemChangeListener | - | ||||||||||||||||||
13 | { | - | ||||||||||||||||||
14 | inline QQuickPathView* q_func() { return static_cast<QQuickPathView *>(q_ptr); } inline const QQuickPathView* q_func() const { return static_cast<const QQuickPathView *>(q_ptr); } friend class QQuickPathView; | - | ||||||||||||||||||
15 | - | |||||||||||||||||||
16 | public: | - | ||||||||||||||||||
17 | QQuickPathViewPrivate(); | - | ||||||||||||||||||
18 | - | |||||||||||||||||||
19 | void init(); | - | ||||||||||||||||||
20 | - | |||||||||||||||||||
21 | void itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &) override { | - | ||||||||||||||||||
22 | if (change.sizeChange()
| 0-58250 | ||||||||||||||||||
23 | if (QQuickPathViewAttached *att = attached(item)
| 0-10 | ||||||||||||||||||
24 | att->m_percent = -1; executed 10 times by 1 test: att->m_percent = -1; Executed by:
| 10 | ||||||||||||||||||
25 | scheduleLayout(); | - | ||||||||||||||||||
26 | } executed 10 times by 1 test: end of block Executed by:
| 10 | ||||||||||||||||||
27 | } executed 58260 times by 3 tests: end of block Executed by:
| 58260 | ||||||||||||||||||
28 | - | |||||||||||||||||||
29 | void scheduleLayout() { | - | ||||||||||||||||||
30 | QQuickPathView * const q = q_func(); | - | ||||||||||||||||||
31 | if (!layoutScheduled
| 24-142 | ||||||||||||||||||
32 | layoutScheduled = true; | - | ||||||||||||||||||
33 | q->polish(); | - | ||||||||||||||||||
34 | } executed 142 times by 2 tests: end of block Executed by:
| 142 | ||||||||||||||||||
35 | } executed 166 times by 2 tests: end of block Executed by:
| 166 | ||||||||||||||||||
36 | - | |||||||||||||||||||
37 | QQuickItem *getItem(int modelIndex, qreal z = 0, bool async=false); | - | ||||||||||||||||||
38 | void releaseItem(QQuickItem *item); | - | ||||||||||||||||||
39 | QQuickPathViewAttached *attached(QQuickItem *item); | - | ||||||||||||||||||
40 | QQmlOpenMetaObjectType *attachedType(); | - | ||||||||||||||||||
41 | void clear(); | - | ||||||||||||||||||
42 | void updateMappedRange(); | - | ||||||||||||||||||
43 | qreal positionOfIndex(qreal index) const; | - | ||||||||||||||||||
44 | bool isInBound(qreal position, qreal lower, qreal upper) const; | - | ||||||||||||||||||
45 | void createHighlight(); | - | ||||||||||||||||||
46 | void updateHighlight(); | - | ||||||||||||||||||
47 | void setHighlightPosition(qreal pos); | - | ||||||||||||||||||
48 | bool isValid() const { | - | ||||||||||||||||||
49 | return executed 9019 times by 3 tests: model && model->count() > 0 && model->isValid() && path;return model && model->count() > 0 && model->isValid() && path; Executed by:
executed 9019 times by 3 tests: return model && model->count() > 0 && model->isValid() && path; Executed by:
| 9019 | ||||||||||||||||||
50 | } | - | ||||||||||||||||||
51 | - | |||||||||||||||||||
52 | void handleMousePressEvent(QMouseEvent *event); | - | ||||||||||||||||||
53 | void handleMouseMoveEvent(QMouseEvent *event); | - | ||||||||||||||||||
54 | void handleMouseReleaseEvent(QMouseEvent *); | - | ||||||||||||||||||
55 | - | |||||||||||||||||||
56 | int calcCurrentIndex(); | - | ||||||||||||||||||
57 | void createCurrentItem(); | - | ||||||||||||||||||
58 | void updateCurrent(); | - | ||||||||||||||||||
59 | static void fixOffsetCallback(void*); | - | ||||||||||||||||||
60 | void fixOffset(); | - | ||||||||||||||||||
61 | void setOffset(qreal offset); | - | ||||||||||||||||||
62 | void setAdjustedOffset(qreal offset); | - | ||||||||||||||||||
63 | void regenerate(); | - | ||||||||||||||||||
64 | void updateItem(QQuickItem *, qreal); | - | ||||||||||||||||||
65 | enum MovementReason { Other, SetIndex, Mouse }; | - | ||||||||||||||||||
66 | void snapToIndex(int index, MovementReason reason); | - | ||||||||||||||||||
67 | QPointF pointNear(const QPointF &point, qreal *nearPercent=0) const; | - | ||||||||||||||||||
68 | void addVelocitySample(qreal v); | - | ||||||||||||||||||
69 | qreal calcVelocity() const; | - | ||||||||||||||||||
70 | qint64 computeCurrentTime(QInputEvent *event) const; | - | ||||||||||||||||||
71 | void setDragging(bool d); | - | ||||||||||||||||||
72 | - | |||||||||||||||||||
73 | QQuickPath *path; | - | ||||||||||||||||||
74 | int currentIndex; | - | ||||||||||||||||||
75 | QPointer<QQuickItem> currentItem; | - | ||||||||||||||||||
76 | qreal currentItemOffset; | - | ||||||||||||||||||
77 | qreal startPc; | - | ||||||||||||||||||
78 | QPointF startPoint; | - | ||||||||||||||||||
79 | QPointF startPos; | - | ||||||||||||||||||
80 | qreal offset; | - | ||||||||||||||||||
81 | qreal offsetAdj; | - | ||||||||||||||||||
82 | qreal mappedRange; | - | ||||||||||||||||||
83 | qreal mappedCache; | - | ||||||||||||||||||
84 | bool stealMouse : 1; | - | ||||||||||||||||||
85 | bool ownModel : 1; | - | ||||||||||||||||||
86 | bool interactive : 1; | - | ||||||||||||||||||
87 | bool haveHighlightRange : 1; | - | ||||||||||||||||||
88 | bool autoHighlight : 1; | - | ||||||||||||||||||
89 | bool highlightUp : 1; | - | ||||||||||||||||||
90 | bool layoutScheduled : 1; | - | ||||||||||||||||||
91 | bool moving : 1; | - | ||||||||||||||||||
92 | bool flicking : 1; | - | ||||||||||||||||||
93 | bool dragging : 1; | - | ||||||||||||||||||
94 | bool inRequest : 1; | - | ||||||||||||||||||
95 | bool delegateValidated : 1; | - | ||||||||||||||||||
96 | bool inRefill : 1; | - | ||||||||||||||||||
97 | QElapsedTimer timer; | - | ||||||||||||||||||
98 | qint64 lastPosTime; | - | ||||||||||||||||||
99 | QPointF lastPos; | - | ||||||||||||||||||
100 | qreal dragMargin; | - | ||||||||||||||||||
101 | qreal deceleration; | - | ||||||||||||||||||
102 | qreal maximumFlickVelocity; | - | ||||||||||||||||||
103 | QQuickTimeLine tl; | - | ||||||||||||||||||
104 | QQuickTimeLineValueProxy<QQuickPathViewPrivate> moveOffset; | - | ||||||||||||||||||
105 | int flickDuration; | - | ||||||||||||||||||
106 | int pathItems; | - | ||||||||||||||||||
107 | int requestedIndex; | - | ||||||||||||||||||
108 | int cacheSize; | - | ||||||||||||||||||
109 | qreal requestedZ; | - | ||||||||||||||||||
110 | QList<QQuickItem *> items; | - | ||||||||||||||||||
111 | QList<QQuickItem *> itemCache; | - | ||||||||||||||||||
112 | QPointer<QQmlInstanceModel> model; | - | ||||||||||||||||||
113 | QVariant modelVariant; | - | ||||||||||||||||||
114 | MovementReason moveReason; | - | ||||||||||||||||||
115 | QQuickPathView::MovementDirection movementDirection; | - | ||||||||||||||||||
116 | QQuickPathView::MovementDirection moveDirection; | - | ||||||||||||||||||
117 | QQmlOpenMetaObjectType *attType; | - | ||||||||||||||||||
118 | QQmlComponent *highlightComponent; | - | ||||||||||||||||||
119 | QQuickItem *highlightItem; | - | ||||||||||||||||||
120 | QQuickTimeLineValueProxy<QQuickPathViewPrivate> moveHighlight; | - | ||||||||||||||||||
121 | qreal highlightPosition; | - | ||||||||||||||||||
122 | qreal highlightRangeStart; | - | ||||||||||||||||||
123 | qreal highlightRangeEnd; | - | ||||||||||||||||||
124 | QQuickPathView::HighlightRangeMode highlightRangeMode; | - | ||||||||||||||||||
125 | int highlightMoveDuration; | - | ||||||||||||||||||
126 | int modelCount; | - | ||||||||||||||||||
127 | QPODVector<qreal,10> velocityBuffer; | - | ||||||||||||||||||
128 | QQuickPathView::SnapMode snapMode; | - | ||||||||||||||||||
129 | }; | - | ||||||||||||||||||
130 | - | |||||||||||||||||||
131 | - | |||||||||||||||||||
Switch to Source code | Preprocessed file |