Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/items/qquickwindow_p.h |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||
2 | - | |||||||||||||
3 | - | |||||||||||||
4 | - | |||||||||||||
5 | - | |||||||||||||
6 | - | |||||||||||||
7 | class QOpenGLVertexArrayObjectHelper; | - | ||||||||||||
8 | class QQuickAnimatorController; | - | ||||||||||||
9 | class QQuickDragGrabber; | - | ||||||||||||
10 | class QQuickItemPrivate; | - | ||||||||||||
11 | class QQuickPointerDevice; | - | ||||||||||||
12 | class QQuickRenderControl; | - | ||||||||||||
13 | class QQuickWindowIncubationController; | - | ||||||||||||
14 | class QQuickWindowPrivate; | - | ||||||||||||
15 | class QQuickWindowRenderLoop; | - | ||||||||||||
16 | class QSGRenderLoop; | - | ||||||||||||
17 | class QTouchEvent; | - | ||||||||||||
18 | - | |||||||||||||
19 | - | |||||||||||||
20 | class QQuickRootItem : public QQuickItem | - | ||||||||||||
21 | { | - | ||||||||||||
22 | public: | - | ||||||||||||
23 | #pragma GCC diagnostic push | - | ||||||||||||
24 | - | |||||||||||||
25 | #pragma GCC diagnostic ignored "-Wsuggest-override" | - | ||||||||||||
26 | 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: | - | ||||||||||||
27 | #pragma GCC diagnostic ignored "-Wattributes" | - | ||||||||||||
28 | __attribute__((visibility("hidden"))) static void qt_static_metacall(QObject *, QMetaObject::Call, int, void **); | - | ||||||||||||
29 | #pragma GCC diagnostic pop | - | ||||||||||||
30 | struct QPrivateSignal {}; | - | ||||||||||||
31 | public: | - | ||||||||||||
32 | QQuickRootItem(); | - | ||||||||||||
33 | public : | - | ||||||||||||
34 | void setWidth(int w) {QQuickItem::setWidth(qreal(w));} never executed: end of block | 0 | ||||||||||||
35 | void setHeight(int h) {QQuickItem::setHeight(qreal(h));} never executed: end of block | 0 | ||||||||||||
36 | }; | - | ||||||||||||
37 | - | |||||||||||||
38 | class __attribute__((visibility("default"))) QQuickCustomRenderStage | - | ||||||||||||
39 | { | - | ||||||||||||
40 | public: | - | ||||||||||||
41 | virtual ~QQuickCustomRenderStage() {} | - | ||||||||||||
42 | virtual bool render() = 0; | - | ||||||||||||
43 | virtual bool swap() = 0; | - | ||||||||||||
44 | }; | - | ||||||||||||
45 | - | |||||||||||||
46 | class __attribute__((visibility("default"))) QQuickWindowPrivate : public QWindowPrivate | - | ||||||||||||
47 | { | - | ||||||||||||
48 | public: | - | ||||||||||||
49 | inline QQuickWindow* q_func() { return static_cast<QQuickWindow *>(q_ptr); } inline const QQuickWindow* q_func() const { return static_cast<const QQuickWindow *>(q_ptr); } friend class QQuickWindow; | - | ||||||||||||
50 | - | |||||||||||||
51 | enum CustomEvents { | - | ||||||||||||
52 | FullUpdateRequest = QEvent::User + 1 | - | ||||||||||||
53 | }; | - | ||||||||||||
54 | - | |||||||||||||
55 | static inline QQuickWindowPrivate *get(QQuickWindow *c) { return executed 4720632 times by 91 tests: c->d_func();return c->d_func(); Executed by:
executed 4720632 times by 91 tests: }return c->d_func(); Executed by:
| 4720632 | ||||||||||||
56 | - | |||||||||||||
57 | QQuickWindowPrivate(); | - | ||||||||||||
58 | ~QQuickWindowPrivate() override; | - | ||||||||||||
59 | - | |||||||||||||
60 | void init(QQuickWindow *, QQuickRenderControl *control = nullptr); | - | ||||||||||||
61 | - | |||||||||||||
62 | QQuickRootItem *contentItem; | - | ||||||||||||
63 | QSet<QQuickItem *> parentlessItems; | - | ||||||||||||
64 | QQmlListProperty<QObject> data(); | - | ||||||||||||
65 | - | |||||||||||||
66 | QQuickItem *activeFocusItem; | - | ||||||||||||
67 | - | |||||||||||||
68 | void deliverKeyEvent(QKeyEvent *e); | - | ||||||||||||
69 | - | |||||||||||||
70 | - | |||||||||||||
71 | - | |||||||||||||
72 | QQuickItem *cursorItem; | - | ||||||||||||
73 | - | |||||||||||||
74 | - | |||||||||||||
75 | QQuickDragGrabber *dragGrabber; | - | ||||||||||||
76 | - | |||||||||||||
77 | int touchMouseId; | - | ||||||||||||
78 | QQuickPointerDevice *touchMouseDevice; | - | ||||||||||||
79 | bool checkIfDoubleClicked(ulong newPressEventTimestamp); | - | ||||||||||||
80 | ulong touchMousePressTimestamp; | - | ||||||||||||
81 | - | |||||||||||||
82 | - | |||||||||||||
83 | QPointF lastMousePosition; | - | ||||||||||||
84 | bool deliverTouchAsMouse(QQuickItem *item, QQuickPointerEvent *pointerEvent); | - | ||||||||||||
85 | bool isDeliveringTouchAsMouse() const { return executed 480365 times by 91 tests: touchMouseId != -1 && touchMouseDevice;return touchMouseId != -1 && touchMouseDevice; Executed by:
executed 480365 times by 91 tests: }return touchMouseId != -1 && touchMouseDevice; Executed by:
| 480365 | ||||||||||||
86 | void translateTouchEvent(QTouchEvent *touchEvent); | - | ||||||||||||
87 | void grabTouchPoints(QObject *grabber, const QVector<int> &ids); | - | ||||||||||||
88 | void removeGrabber(QQuickItem *grabber, bool mouse = true, bool touch = true); | - | ||||||||||||
89 | void sendUngrabEvent(QQuickItem *grabber, bool touch); | - | ||||||||||||
90 | static QMouseEvent *cloneMouseEvent(QMouseEvent *event, QPointF *transformedLocalPos = nullptr); | - | ||||||||||||
91 | void deliverToPassiveGrabbers(const QVector<QPointer <QQuickPointerHandler> > &passiveGrabbers, QQuickPointerEvent *pointerEvent); | - | ||||||||||||
92 | void deliverMouseEvent(QQuickPointerMouseEvent *pointerEvent); | - | ||||||||||||
93 | bool sendFilteredMouseEvent(QEvent *event, QQuickItem *receiver, QQuickItem *filteringParent); | - | ||||||||||||
94 | bool sendFilteredPointerEvent(QQuickPointerEvent *event, QQuickItem *receiver, QQuickItem *filteringParent = nullptr); | - | ||||||||||||
95 | bool sendFilteredPointerEventImpl(QQuickPointerEvent *event, QQuickItem *receiver, QQuickItem *filteringParent); | - | ||||||||||||
96 | bool deliverSinglePointEventUntilAccepted(QQuickPointerEvent *); | - | ||||||||||||
97 | - | |||||||||||||
98 | - | |||||||||||||
99 | void handleTouchEvent(QTouchEvent *); | - | ||||||||||||
100 | void handleMouseEvent(QMouseEvent *); | - | ||||||||||||
101 | bool compressTouchEvent(QTouchEvent *); | - | ||||||||||||
102 | void flushFrameSynchronousEvents(); | - | ||||||||||||
103 | void deliverDelayedTouchEvent(); | - | ||||||||||||
104 | - | |||||||||||||
105 | - | |||||||||||||
106 | mutable QVector<QQuickPointerEvent *> pointerEventInstances; | - | ||||||||||||
107 | QQuickPointerEvent *queryPointerEventInstance(QQuickPointerDevice *device, QEvent::Type eventType = QEvent::None) const; | - | ||||||||||||
108 | QQuickPointerEvent *pointerEventInstance(QQuickPointerDevice *device, QEvent::Type eventType = QEvent::None) const; | - | ||||||||||||
109 | - | |||||||||||||
110 | - | |||||||||||||
111 | QQuickPointerEvent *pointerEventInstance(QEvent *ev) const; | - | ||||||||||||
112 | void deliverPointerEvent(QQuickPointerEvent *); | - | ||||||||||||
113 | void deliverTouchEvent(QQuickPointerTouchEvent *); | - | ||||||||||||
114 | bool deliverTouchCancelEvent(QTouchEvent *); | - | ||||||||||||
115 | bool deliverPressOrReleaseEvent(QQuickPointerEvent *, bool handlersOnly = false); | - | ||||||||||||
116 | void deliverUpdatedTouchPoints(QQuickPointerTouchEvent *event); | - | ||||||||||||
117 | void deliverMatchingPointsToItem(QQuickItem *item, QQuickPointerEvent *pointerEvent, bool handlersOnly = false); | - | ||||||||||||
118 | - | |||||||||||||
119 | QVector<QQuickItem *> pointerTargets(QQuickItem *, QQuickEventPoint *point, bool checkMouseButtons, bool checkAcceptsTouch) const; | - | ||||||||||||
120 | QVector<QQuickItem *> mergePointerTargets(const QVector<QQuickItem *> &list1, const QVector<QQuickItem *> &list2) const; | - | ||||||||||||
121 | - | |||||||||||||
122 | - | |||||||||||||
123 | bool deliverHoverEvent(QQuickItem *, const QPointF &scenePos, const QPointF &lastScenePos, Qt::KeyboardModifiers modifiers, ulong timestamp, bool &accepted); | - | ||||||||||||
124 | bool sendHoverEvent(QEvent::Type, QQuickItem *, const QPointF &scenePos, const QPointF &lastScenePos, | - | ||||||||||||
125 | Qt::KeyboardModifiers modifiers, ulong timestamp, bool accepted); | - | ||||||||||||
126 | bool clearHover(ulong timestamp = 0); | - | ||||||||||||
127 | - | |||||||||||||
128 | - | |||||||||||||
129 | void deliverDragEvent(QQuickDragGrabber *, QEvent *); | - | ||||||||||||
130 | bool deliverDragEvent(QQuickDragGrabber *, QQuickItem *, QDragMoveEvent *); | - | ||||||||||||
131 | - | |||||||||||||
132 | - | |||||||||||||
133 | void updateCursor(const QPointF &scenePos); | - | ||||||||||||
134 | QQuickItem *findCursorItem(QQuickItem *item, const QPointF &scenePos); | - | ||||||||||||
135 | - | |||||||||||||
136 | - | |||||||||||||
137 | QList<QQuickItem*> hoverItems; | - | ||||||||||||
138 | enum FocusOption { | - | ||||||||||||
139 | DontChangeFocusProperty = 0x01, | - | ||||||||||||
140 | DontChangeSubFocusItem = 0x02 | - | ||||||||||||
141 | }; | - | ||||||||||||
142 | typedef QFlags<FocusOption> FocusOptions; | - | ||||||||||||
143 | - | |||||||||||||
144 | void setFocusInScope(QQuickItem *scope, QQuickItem *item, Qt::FocusReason reason, FocusOptions = nullptr); | - | ||||||||||||
145 | void clearFocusInScope(QQuickItem *scope, QQuickItem *item, Qt::FocusReason reason, FocusOptions = nullptr); | - | ||||||||||||
146 | static void notifyFocusChangesRecur(QQuickItem **item, int remaining); | - | ||||||||||||
147 | void clearFocusObject() override; | - | ||||||||||||
148 | - | |||||||||||||
149 | void updateFocusItemTransform(); | - | ||||||||||||
150 | - | |||||||||||||
151 | void dirtyItem(QQuickItem *); | - | ||||||||||||
152 | void cleanup(QSGNode *); | - | ||||||||||||
153 | - | |||||||||||||
154 | void polishItems(); | - | ||||||||||||
155 | void forcePolish(); | - | ||||||||||||
156 | void syncSceneGraph(); | - | ||||||||||||
157 | void renderSceneGraph(const QSize &size); | - | ||||||||||||
158 | - | |||||||||||||
159 | bool isRenderable() const; | - | ||||||||||||
160 | - | |||||||||||||
161 | bool emitError(QQuickWindow::SceneGraphError error, const QString &msg); | - | ||||||||||||
162 | - | |||||||||||||
163 | QQuickItem::UpdatePaintNodeData updatePaintNodeData; | - | ||||||||||||
164 | - | |||||||||||||
165 | QQuickItem *dirtyItemList; | - | ||||||||||||
166 | QList<QSGNode *> cleanupNodeList; | - | ||||||||||||
167 | - | |||||||||||||
168 | QVector<QQuickItem *> itemsToPolish; | - | ||||||||||||
169 | QVector<QQuickItem *> hasFiltered; | - | ||||||||||||
170 | QVector<QQuickItem *> skipDelivery; | - | ||||||||||||
171 | - | |||||||||||||
172 | qreal devicePixelRatio; | - | ||||||||||||
173 | QMetaObject::Connection physicalDpiChangedConnection; | - | ||||||||||||
174 | - | |||||||||||||
175 | void updateDirtyNodes(); | - | ||||||||||||
176 | void cleanupNodes(); | - | ||||||||||||
177 | void cleanupNodesOnShutdown(); | - | ||||||||||||
178 | bool updateEffectiveOpacity(QQuickItem *); | - | ||||||||||||
179 | void updateEffectiveOpacityRoot(QQuickItem *, qreal); | - | ||||||||||||
180 | void updateDirtyNode(QQuickItem *); | - | ||||||||||||
181 | - | |||||||||||||
182 | void fireFrameSwapped() { q_func()->frameSwapped(); } executed 49429 times by 76 tests: end of block Executed by:
| 49429 | ||||||||||||
183 | void fireOpenGLContextCreated(QOpenGLContext *context) { q_func()->openglContextCreated(context); } executed 3102 times by 75 tests: end of block Executed by:
| 3102 | ||||||||||||
184 | void fireAboutToStop() { q_func()->sceneGraphAboutToStop(); } executed 5722 times by 91 tests: end of block Executed by:
| 5722 | ||||||||||||
185 | - | |||||||||||||
186 | QSGRenderContext *context; | - | ||||||||||||
187 | QSGRenderer *renderer; | - | ||||||||||||
188 | QByteArray customRenderMode; | - | ||||||||||||
189 | - | |||||||||||||
190 | QSGRenderLoop *windowManager; | - | ||||||||||||
191 | QQuickRenderControl *renderControl; | - | ||||||||||||
192 | QQuickAnimatorController *animationController; | - | ||||||||||||
193 | QScopedPointer<QTouchEvent> delayedTouch; | - | ||||||||||||
194 | - | |||||||||||||
195 | int pointerEventRecursionGuard; | - | ||||||||||||
196 | QQuickCustomRenderStage *customRenderStage; | - | ||||||||||||
197 | - | |||||||||||||
198 | QColor clearColor; | - | ||||||||||||
199 | - | |||||||||||||
200 | uint clearBeforeRendering : 1; | - | ||||||||||||
201 | - | |||||||||||||
202 | uint persistentGLContext : 1; | - | ||||||||||||
203 | uint persistentSceneGraph : 1; | - | ||||||||||||
204 | - | |||||||||||||
205 | uint lastWheelEventAccepted : 1; | - | ||||||||||||
206 | bool componentCompleted : 1; | - | ||||||||||||
207 | - | |||||||||||||
208 | bool allowChildEventFiltering : 1; | - | ||||||||||||
209 | bool allowDoubleClick : 1; | - | ||||||||||||
210 | - | |||||||||||||
211 | Qt::FocusReason lastFocusReason; | - | ||||||||||||
212 | - | |||||||||||||
213 | QOpenGLFramebufferObject *renderTarget; | - | ||||||||||||
214 | uint renderTargetId; | - | ||||||||||||
215 | QSize renderTargetSize; | - | ||||||||||||
216 | - | |||||||||||||
217 | QOpenGLVertexArrayObjectHelper *vaoHelper; | - | ||||||||||||
218 | - | |||||||||||||
219 | mutable QQuickWindowIncubationController *incubationController; | - | ||||||||||||
220 | - | |||||||||||||
221 | static bool defaultAlphaBuffer; | - | ||||||||||||
222 | static QQuickWindow::TextRenderType textRenderType; | - | ||||||||||||
223 | - | |||||||||||||
224 | static bool dragOverThreshold(qreal d, Qt::Axis axis, QMouseEvent *event, int startDragThreshold = -1); | - | ||||||||||||
225 | - | |||||||||||||
226 | template <typename TEventPoint> | - | ||||||||||||
227 | static bool dragOverThreshold(qreal d, Qt::Axis axis, const TEventPoint *p, int startDragThreshold = -1) | - | ||||||||||||
228 | { | - | ||||||||||||
229 | QStyleHints *styleHints = (static_cast<QGuiApplication *>(QCoreApplication::instance()))->styleHints(); | - | ||||||||||||
230 | bool overThreshold = qAbs(d) > (startDragThreshold >= 0 ? startDragThreshold : styleHints->startDragDistance()); | - | ||||||||||||
231 | const bool dragVelocityLimitAvailable = (styleHints->startDragVelocity() > 0); | - | ||||||||||||
232 | if (!overThreshold
| 0-4456 | ||||||||||||
233 | qreal velocity = axis == Qt::XAxis
| 0 | ||||||||||||
234 | overThreshold |= qAbs(velocity) > styleHints->startDragVelocity(); | - | ||||||||||||
235 | } never executed: end of block | 0 | ||||||||||||
236 | return executed 5008 times by 4 tests: overThreshold;return overThreshold; Executed by:
executed 5008 times by 4 tests: return overThreshold; Executed by:
| 5008 | ||||||||||||
237 | } | - | ||||||||||||
238 | - | |||||||||||||
239 | static bool dragOverThreshold(const QQuickEventPoint *point) | - | ||||||||||||
240 | { | - | ||||||||||||
241 | QPointF delta = point->scenePosition() - point->scenePressPosition(); | - | ||||||||||||
242 | return executed 4 times by 1 test: (QQuickWindowPrivate::dragOverThreshold(delta.x(), Qt::XAxis, point) ||return (QQuickWindowPrivate::dragOverThreshold(delta.x(), Qt::XAxis, point) || QQuickWindowPrivate::dragOverThreshold(delta.y(), Qt::YAxis, point)); Executed by:
executed 4 times by 1 test: return (QQuickWindowPrivate::dragOverThreshold(delta.x(), Qt::XAxis, point) || QQuickWindowPrivate::dragOverThreshold(delta.y(), Qt::YAxis, point)); Executed by:
| 4 | ||||||||||||
243 | QQuickWindowPrivate::dragOverThreshold(delta.y(), Qt::YAxis, point)); executed 4 times by 1 test: return (QQuickWindowPrivate::dragOverThreshold(delta.x(), Qt::XAxis, point) || QQuickWindowPrivate::dragOverThreshold(delta.y(), Qt::YAxis, point)); Executed by:
| 4 | ||||||||||||
244 | } | - | ||||||||||||
245 | - | |||||||||||||
246 | - | |||||||||||||
247 | - | |||||||||||||
248 | static void data_append(QQmlListProperty<QObject> *, QObject *); | - | ||||||||||||
249 | static int data_count(QQmlListProperty<QObject> *); | - | ||||||||||||
250 | static QObject *data_at(QQmlListProperty<QObject> *, int); | - | ||||||||||||
251 | static void data_clear(QQmlListProperty<QObject> *); | - | ||||||||||||
252 | - | |||||||||||||
253 | static void contextCreationFailureMessage(const QSurfaceFormat &format, | - | ||||||||||||
254 | QString *translatedMessage, | - | ||||||||||||
255 | QString *untranslatedMessage, | - | ||||||||||||
256 | bool isEs); | - | ||||||||||||
257 | - | |||||||||||||
258 | QMutex renderJobMutex; | - | ||||||||||||
259 | QList<QRunnable *> beforeSynchronizingJobs; | - | ||||||||||||
260 | QList<QRunnable *> afterSynchronizingJobs; | - | ||||||||||||
261 | QList<QRunnable *> beforeRenderingJobs; | - | ||||||||||||
262 | QList<QRunnable *> afterRenderingJobs; | - | ||||||||||||
263 | QList<QRunnable *> afterSwapJobs; | - | ||||||||||||
264 | - | |||||||||||||
265 | void runAndClearJobs(QList<QRunnable *> *jobs); | - | ||||||||||||
266 | - | |||||||||||||
267 | private: | - | ||||||||||||
268 | static void cleanupNodesOnShutdown(QQuickItem *); | - | ||||||||||||
269 | }; | - | ||||||||||||
270 | - | |||||||||||||
271 | class QQuickWindowQObjectCleanupJob : public QRunnable | - | ||||||||||||
272 | { | - | ||||||||||||
273 | public: | - | ||||||||||||
274 | QQuickWindowQObjectCleanupJob(QObject *o) : object(o) { } executed 2 times by 1 test: end of block Executed by:
| 2 | ||||||||||||
275 | void run() override { delete object; } executed 2 times by 1 test: end of block Executed by:
| 2 | ||||||||||||
276 | QObject *object; | - | ||||||||||||
277 | static void schedule(QQuickWindow *window, QObject *object) { | - | ||||||||||||
278 | ((window) ? static_cast<void>(0) : qt_assert("window", __FILE__, 337)); | - | ||||||||||||
279 | ((object) ? static_cast<void>(0) : qt_assert("object", __FILE__, 338)); | - | ||||||||||||
280 | window->scheduleRenderJob(new QQuickWindowQObjectCleanupJob(object), QQuickWindow::AfterSynchronizingStage); | - | ||||||||||||
281 | } executed 2 times by 1 test: end of block Executed by:
| 2 | ||||||||||||
282 | }; | - | ||||||||||||
283 | - | |||||||||||||
284 | constexpr inline QFlags<QQuickWindowPrivate::FocusOptions::enum_type> operator|(QQuickWindowPrivate::FocusOptions::enum_type f1, QQuickWindowPrivate::FocusOptions::enum_type f2) noexcept { return QFlags<QQuickWindowPrivate::FocusOptions::enum_type>(f1) | f2; } constexpr inline QFlags<QQuickWindowPrivate::FocusOptions::enum_type> operator|(QQuickWindowPrivate::FocusOptions::enum_type f1, QFlags<QQuickWindowPrivate::FocusOptions::enum_type> f2) noexcept { return f2 | f1; } constexpr inline QIncompatibleFlag operator|(QQuickWindowPrivate::FocusOptions::enum_type f1, int f2) noexcept { return QIncompatibleFlag(int(f1) | f2); } | - | ||||||||||||
285 | - | |||||||||||||
286 | - | |||||||||||||
Switch to Source code | Preprocessed file |