1 | // Copyright (C) 2020 The Qt Company Ltd. |
---|---|
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | |
4 | #ifndef QEVENT_H |
5 | #define QEVENT_H |
6 | |
7 | #if 0 |
8 | #pragma qt_class(QtEvents) |
9 | #endif |
10 | |
11 | #include <QtGui/qtguiglobal.h> |
12 | |
13 | #include <QtCore/qcoreevent.h> |
14 | #include <QtCore/qiodevice.h> |
15 | #include <QtCore/qlist.h> |
16 | #include <QtCore/qnamespace.h> |
17 | #include <QtCore/qstring.h> |
18 | #include <QtCore/qurl.h> |
19 | #include <QtCore/qvariant.h> |
20 | #include <QtGui/qeventpoint.h> |
21 | #include <QtGui/qpointingdevice.h> |
22 | #include <QtGui/qregion.h> |
23 | #include <QtGui/qwindowdefs.h> |
24 | |
25 | #if QT_CONFIG(shortcut) |
26 | # include <QtGui/qkeysequence.h> |
27 | #endif |
28 | |
29 | class tst_QEvent; |
30 | |
31 | QT_BEGIN_NAMESPACE |
32 | |
33 | class QFile; |
34 | class QAction; |
35 | class QMouseEvent; |
36 | template <typename T> class QPointer; |
37 | class QPointerEvent; |
38 | class QScreen; |
39 | #if QT_CONFIG(shortcut) |
40 | class QShortcut; |
41 | #endif |
42 | class QTabletEvent; |
43 | class QTouchEvent; |
44 | #if QT_CONFIG(gestures) |
45 | class QGesture; |
46 | #endif |
47 | |
48 | class Q_GUI_EXPORT QInputEvent : public QEvent |
49 | { |
50 | Q_DECL_EVENT_COMMON(QInputEvent) |
51 | public: |
52 | explicit QInputEvent(Type type, const QInputDevice *m_dev, Qt::KeyboardModifiers modifiers = Qt::NoModifier); |
53 | |
54 | const QInputDevice *device() const { return m_dev; } |
55 | QInputDevice::DeviceType deviceType() const { return m_dev ? m_dev->type() : QInputDevice::DeviceType::Unknown; } |
56 | inline Qt::KeyboardModifiers modifiers() const { return m_modState; } |
57 | inline void setModifiers(Qt::KeyboardModifiers modifiers) { m_modState = modifiers; } |
58 | inline quint64 timestamp() const { return m_timeStamp; } |
59 | virtual void setTimestamp(quint64 timestamp) { m_timeStamp = timestamp; } |
60 | |
61 | protected: |
62 | QInputEvent(Type type, PointerEventTag, const QInputDevice *dev, Qt::KeyboardModifiers modifiers = Qt::NoModifier); |
63 | QInputEvent(Type type, SinglePointEventTag, const QInputDevice *dev, Qt::KeyboardModifiers modifiers = Qt::NoModifier); |
64 | |
65 | const QInputDevice *m_dev = nullptr; |
66 | quint64 m_timeStamp = 0; |
67 | Qt::KeyboardModifiers m_modState = Qt::NoModifier; |
68 | // fill up to the closest 8-byte aligned size: 48 |
69 | quint32 m_reserved = 0; |
70 | }; |
71 | |
72 | class Q_GUI_EXPORT QPointerEvent : public QInputEvent |
73 | { |
74 | Q_GADGET |
75 | Q_DECL_EVENT_COMMON(QPointerEvent) |
76 | public: |
77 | explicit QPointerEvent(Type type, const QPointingDevice *dev, |
78 | Qt::KeyboardModifiers modifiers = Qt::NoModifier, const QList<QEventPoint> &points = {}); |
79 | |
80 | const QPointingDevice *pointingDevice() const; |
81 | QPointingDevice::PointerType pointerType() const { |
82 | return pointingDevice() ? pointingDevice()->pointerType() : QPointingDevice::PointerType::Unknown; |
83 | } |
84 | void setTimestamp(quint64 timestamp) override; |
85 | qsizetype pointCount() const { return m_points.size(); } |
86 | QEventPoint &point(qsizetype i); |
87 | const QList<QEventPoint> &points() const { return m_points; } |
88 | QEventPoint *pointById(int id); |
89 | bool allPointsGrabbed() const; |
90 | virtual bool isBeginEvent() const { return false; } |
91 | virtual bool isUpdateEvent() const { return false; } |
92 | virtual bool isEndEvent() const { return false; } |
93 | bool allPointsAccepted() const; |
94 | virtual void setAccepted(bool accepted) override; |
95 | QObject *exclusiveGrabber(const QEventPoint &point) const; |
96 | void setExclusiveGrabber(const QEventPoint &point, QObject *exclusiveGrabber); |
97 | QList<QPointer <QObject>> passiveGrabbers(const QEventPoint &point) const; |
98 | void clearPassiveGrabbers(const QEventPoint &point); |
99 | bool addPassiveGrabber(const QEventPoint &point, QObject *grabber); |
100 | bool removePassiveGrabber(const QEventPoint &point, QObject *grabber); |
101 | |
102 | protected: |
103 | QPointerEvent(Type type, SinglePointEventTag, const QInputDevice *dev, Qt::KeyboardModifiers modifiers = Qt::NoModifier); |
104 | |
105 | QList<QEventPoint> m_points; |
106 | }; |
107 | |
108 | class Q_GUI_EXPORT QSinglePointEvent : public QPointerEvent |
109 | { |
110 | Q_GADGET |
111 | Q_PROPERTY(QObject *exclusivePointGrabber READ exclusivePointGrabber |
112 | WRITE setExclusivePointGrabber) |
113 | |
114 | Q_DECL_EVENT_COMMON(QSinglePointEvent) |
115 | public: |
116 | inline Qt::MouseButton button() const { return m_button; } |
117 | inline Qt::MouseButtons buttons() const { return m_mouseState; } |
118 | |
119 | inline QPointF position() const |
120 | { Q_ASSERT(!m_points.isEmpty()); return m_points.first().position(); } |
121 | inline QPointF scenePosition() const |
122 | { Q_ASSERT(!m_points.isEmpty()); return m_points.first().scenePosition(); } |
123 | inline QPointF globalPosition() const |
124 | { Q_ASSERT(!m_points.isEmpty()); return m_points.first().globalPosition(); } |
125 | |
126 | bool isBeginEvent() const override; |
127 | bool isUpdateEvent() const override; |
128 | bool isEndEvent() const override; |
129 | |
130 | QObject *exclusivePointGrabber() const |
131 | { return QPointerEvent::exclusiveGrabber(point: points().first()); } |
132 | void setExclusivePointGrabber(QObject *exclusiveGrabber) |
133 | { QPointerEvent::setExclusiveGrabber(point: points().first(), exclusiveGrabber); } |
134 | |
135 | protected: |
136 | friend class ::tst_QEvent; |
137 | QSinglePointEvent(Type type, const QPointingDevice *dev, const QEventPoint &point, |
138 | Qt::MouseButton button, Qt::MouseButtons buttons, |
139 | Qt::KeyboardModifiers modifiers, Qt::MouseEventSource source); |
140 | QSinglePointEvent(Type type, const QPointingDevice *dev, const QPointF &localPos, |
141 | const QPointF &scenePos, const QPointF &globalPos, |
142 | Qt::MouseButton button, Qt::MouseButtons buttons, |
143 | Qt::KeyboardModifiers modifiers, |
144 | Qt::MouseEventSource source = Qt::MouseEventNotSynthesized); |
145 | |
146 | Qt::MouseButton m_button = Qt::NoButton; |
147 | Qt::MouseButtons m_mouseState = Qt::NoButton; |
148 | Qt::MouseEventSource m_source; |
149 | /* |
150 | Fill up to the next 8-byte aligned size: 88 |
151 | We have 32bits left, use some for QSinglePointEvent subclasses so that |
152 | we don't end up with gaps. |
153 | */ |
154 | // split this in two quint16; with a quint32, MSVC would 32-bit align it |
155 | quint16 m_reserved; |
156 | quint16 m_reserved2 : 11; |
157 | // for QMouseEvent |
158 | quint16 m_doubleClick : 1; |
159 | // for QWheelEvent |
160 | quint16 m_phase : 3; |
161 | quint16 m_invertedScrolling : 1; |
162 | }; |
163 | |
164 | class Q_GUI_EXPORT QEnterEvent : public QSinglePointEvent |
165 | { |
166 | Q_DECL_EVENT_COMMON(QEnterEvent) |
167 | public: |
168 | QEnterEvent(const QPointF &localPos, const QPointF &scenePos, const QPointF &globalPos, |
169 | const QPointingDevice *device = QPointingDevice::primaryPointingDevice()); |
170 | |
171 | #if QT_DEPRECATED_SINCE(6, 0) |
172 | #ifndef QT_NO_INTEGER_EVENT_COORDINATES |
173 | QT_DEPRECATED_VERSION_X_6_0("Use position()") |
174 | inline QPoint pos() const { return position().toPoint(); } |
175 | QT_DEPRECATED_VERSION_X_6_0("Use globalPosition()") |
176 | inline QPoint globalPos() const { return globalPosition().toPoint(); } |
177 | QT_DEPRECATED_VERSION_X_6_0("Use position()") |
178 | inline int x() const { return qRound(position().x()); } |
179 | QT_DEPRECATED_VERSION_X_6_0("Use position()") |
180 | inline int y() const { return qRound(position().y()); } |
181 | QT_DEPRECATED_VERSION_X_6_0("Use globalPosition()") |
182 | inline int globalX() const { return qRound(globalPosition().x()); } |
183 | QT_DEPRECATED_VERSION_X_6_0("Use globalPosition()") |
184 | inline int globalY() const { return qRound(globalPosition().y()); } |
185 | #endif |
186 | QT_DEPRECATED_VERSION_X_6_0("Use position()") |
187 | QPointF localPos() const { return position(); } |
188 | QT_DEPRECATED_VERSION_X_6_0("Use scenePosition()") |
189 | QPointF windowPos() const { return scenePosition(); } |
190 | QT_DEPRECATED_VERSION_X_6_0("Use globalPosition()") |
191 | QPointF screenPos() const { return globalPosition(); } |
192 | #endif // QT_DEPRECATED_SINCE(6, 0) |
193 | }; |
194 | |
195 | class Q_GUI_EXPORT QMouseEvent : public QSinglePointEvent |
196 | { |
197 | Q_DECL_EVENT_COMMON(QMouseEvent) |
198 | public: |
199 | #if QT_DEPRECATED_SINCE(6, 4) |
200 | QT_DEPRECATED_VERSION_X_6_4("Use another constructor") |
201 | QMouseEvent(Type type, const QPointF &localPos, Qt::MouseButton button, |
202 | Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, |
203 | const QPointingDevice *device = QPointingDevice::primaryPointingDevice()); |
204 | #endif |
205 | QMouseEvent(Type type, const QPointF &localPos, const QPointF &globalPos, |
206 | Qt::MouseButton button, Qt::MouseButtons buttons, |
207 | Qt::KeyboardModifiers modifiers, |
208 | const QPointingDevice *device = QPointingDevice::primaryPointingDevice()); |
209 | QMouseEvent(Type type, const QPointF &localPos, const QPointF &scenePos, const QPointF &globalPos, |
210 | Qt::MouseButton button, Qt::MouseButtons buttons, |
211 | Qt::KeyboardModifiers modifiers, |
212 | const QPointingDevice *device = QPointingDevice::primaryPointingDevice()); |
213 | QMouseEvent(Type type, const QPointF &localPos, const QPointF &scenePos, const QPointF &globalPos, |
214 | Qt::MouseButton button, Qt::MouseButtons buttons, |
215 | Qt::KeyboardModifiers modifiers, Qt::MouseEventSource source, |
216 | const QPointingDevice *device = QPointingDevice::primaryPointingDevice()); |
217 | |
218 | #ifndef QT_NO_INTEGER_EVENT_COORDINATES |
219 | inline QPoint pos() const { return position().toPoint(); } |
220 | #endif |
221 | #if QT_DEPRECATED_SINCE(6, 0) |
222 | #ifndef QT_NO_INTEGER_EVENT_COORDINATES |
223 | QT_DEPRECATED_VERSION_X_6_0("Use globalPosition()") |
224 | inline QPoint globalPos() const { return globalPosition().toPoint(); } |
225 | QT_DEPRECATED_VERSION_X_6_0("Use position()") |
226 | inline int x() const { return qRound(position().x()); } |
227 | QT_DEPRECATED_VERSION_X_6_0("Use position()") |
228 | inline int y() const { return qRound(position().y()); } |
229 | QT_DEPRECATED_VERSION_X_6_0("Use globalPosition()") |
230 | inline int globalX() const { return qRound(globalPosition().x()); } |
231 | QT_DEPRECATED_VERSION_X_6_0("Use globalPosition()") |
232 | inline int globalY() const { return qRound(globalPosition().y()); } |
233 | #endif // QT_NO_INTEGER_EVENT_COORDINATES |
234 | QT_DEPRECATED_VERSION_X_6_0("Use position()") |
235 | QPointF localPos() const { return position(); } |
236 | QT_DEPRECATED_VERSION_X_6_0("Use scenePosition()") |
237 | QPointF windowPos() const { return scenePosition(); } |
238 | QT_DEPRECATED_VERSION_X_6_0("Use globalPosition()") |
239 | QPointF screenPos() const { return globalPosition(); } |
240 | #endif // QT_DEPRECATED_SINCE(6, 0) |
241 | Qt::MouseEventSource source() const; |
242 | Qt::MouseEventFlags flags() const; |
243 | }; |
244 | |
245 | class Q_GUI_EXPORT QHoverEvent : public QSinglePointEvent |
246 | { |
247 | Q_DECL_EVENT_COMMON(QHoverEvent) |
248 | public: |
249 | QHoverEvent(Type type, const QPointF &scenePos, const QPointF &globalPos, const QPointF &oldPos, |
250 | Qt::KeyboardModifiers modifiers = Qt::NoModifier, |
251 | const QPointingDevice *device = QPointingDevice::primaryPointingDevice()); |
252 | #if QT_DEPRECATED_SINCE(6, 3) |
253 | QT_DEPRECATED_VERSION_X_6_3("Use the other constructor") |
254 | QHoverEvent(Type type, const QPointF &pos, const QPointF &oldPos, |
255 | Qt::KeyboardModifiers modifiers = Qt::NoModifier, |
256 | const QPointingDevice *device = QPointingDevice::primaryPointingDevice()); |
257 | #endif |
258 | |
259 | #if QT_DEPRECATED_SINCE(6, 0) |
260 | #ifndef QT_NO_INTEGER_EVENT_COORDINATES |
261 | QT_DEPRECATED_VERSION_X_6_0("Use position()") |
262 | inline QPoint pos() const { return position().toPoint(); } |
263 | #endif |
264 | |
265 | QT_DEPRECATED_VERSION_X_6_0("Use position()") |
266 | inline QPointF posF() const { return position(); } |
267 | #endif // QT_DEPRECATED_SINCE(6, 0) |
268 | |
269 | bool isUpdateEvent() const override { return true; } |
270 | |
271 | // TODO deprecate when we figure out an actual replacement (point history?) |
272 | inline QPoint oldPos() const { return m_oldPos.toPoint(); } |
273 | inline QPointF oldPosF() const { return m_oldPos; } |
274 | |
275 | protected: |
276 | QPointF m_oldPos; // TODO remove? |
277 | }; |
278 | |
279 | #if QT_CONFIG(wheelevent) |
280 | class Q_GUI_EXPORT QWheelEvent : public QSinglePointEvent |
281 | { |
282 | Q_GADGET |
283 | Q_PROPERTY(const QPointingDevice *device READ pointingDevice) |
284 | Q_PROPERTY(QPoint pixelDelta READ pixelDelta) |
285 | Q_PROPERTY(QPoint angleDelta READ angleDelta) |
286 | Q_PROPERTY(Qt::ScrollPhase phase READ phase) |
287 | Q_PROPERTY(bool inverted READ inverted) |
288 | |
289 | Q_DECL_EVENT_COMMON(QWheelEvent) |
290 | public: |
291 | enum { DefaultDeltasPerStep = 120 }; |
292 | |
293 | QWheelEvent(const QPointF &pos, const QPointF &globalPos, QPoint pixelDelta, QPoint angleDelta, |
294 | Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Qt::ScrollPhase phase, |
295 | bool inverted, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized, |
296 | const QPointingDevice *device = QPointingDevice::primaryPointingDevice()); |
297 | |
298 | inline QPoint pixelDelta() const { return m_pixelDelta; } |
299 | inline QPoint angleDelta() const { return m_angleDelta; } |
300 | |
301 | inline Qt::ScrollPhase phase() const { return Qt::ScrollPhase(m_phase); } |
302 | inline bool inverted() const { return m_invertedScrolling; } |
303 | inline bool isInverted() const { return m_invertedScrolling; } |
304 | inline bool hasPixelDelta() const { return !m_pixelDelta.isNull(); } |
305 | |
306 | bool isBeginEvent() const override; |
307 | bool isUpdateEvent() const override; |
308 | bool isEndEvent() const override; |
309 | Qt::MouseEventSource source() const { return Qt::MouseEventSource(m_source); } |
310 | |
311 | protected: |
312 | QPoint m_pixelDelta; |
313 | QPoint m_angleDelta; |
314 | }; |
315 | #endif |
316 | |
317 | #if QT_CONFIG(tabletevent) |
318 | class Q_GUI_EXPORT QTabletEvent : public QSinglePointEvent |
319 | { |
320 | Q_DECL_EVENT_COMMON(QTabletEvent) |
321 | public: |
322 | QTabletEvent(Type t, const QPointingDevice *device, |
323 | const QPointF &pos, const QPointF &globalPos, |
324 | qreal pressure, float xTilt, float yTilt, |
325 | float tangentialPressure, qreal rotation, float z, |
326 | Qt::KeyboardModifiers keyState, |
327 | Qt::MouseButton button, Qt::MouseButtons buttons); |
328 | |
329 | #if QT_DEPRECATED_SINCE(6, 0) |
330 | QT_DEPRECATED_VERSION_X_6_0("Use position()") |
331 | inline QPoint pos() const { return position().toPoint(); } |
332 | QT_DEPRECATED_VERSION_X_6_0("Use globalPosition()") |
333 | inline QPoint globalPos() const { return globalPosition().toPoint(); } |
334 | |
335 | QT_DEPRECATED_VERSION_X_6_0("Use position()") |
336 | inline const QPointF posF() const { return position(); } |
337 | QT_DEPRECATED_VERSION_X_6_0("Use globalPosition()") |
338 | inline const QPointF globalPosF() const { return globalPosition(); } |
339 | QT_DEPRECATED_VERSION_X_6_0("Use position().x()") |
340 | inline int x() const { return qRound(d: position().x()); } |
341 | QT_DEPRECATED_VERSION_X_6_0("Use position().y()") |
342 | inline int y() const { return qRound(d: position().y()); } |
343 | QT_DEPRECATED_VERSION_X_6_0("Use globalPosition().x()") |
344 | inline int globalX() const { return qRound(d: globalPosition().x()); } |
345 | QT_DEPRECATED_VERSION_X_6_0("Use globalPosition().y()") |
346 | inline int globalY() const { return qRound(d: globalPosition().y()); } |
347 | QT_DEPRECATED_VERSION_X_6_0("use globalPosition().x()") |
348 | inline qreal hiResGlobalX() const { return globalPosition().x(); } |
349 | QT_DEPRECATED_VERSION_X_6_0("use globalPosition().y()") |
350 | inline qreal hiResGlobalY() const { return globalPosition().y(); } |
351 | QT_DEPRECATED_VERSION_X_6_0("use pointingDevice().uniqueId()") |
352 | inline qint64 uniqueId() const { return pointingDevice() ? pointingDevice()->uniqueId().numericId() : -1; } |
353 | #endif |
354 | inline qreal pressure() const { Q_ASSERT(!points().isEmpty()); return points().first().pressure(); } |
355 | inline qreal rotation() const { Q_ASSERT(!points().isEmpty()); return points().first().rotation(); } |
356 | inline qreal z() const { return m_z; } |
357 | inline qreal tangentialPressure() const { return m_tangential; } |
358 | inline qreal xTilt() const { return m_xTilt; } |
359 | inline qreal yTilt() const { return m_yTilt; } |
360 | |
361 | protected: |
362 | float m_tangential; |
363 | float m_xTilt; |
364 | float m_yTilt; |
365 | float m_z; |
366 | }; |
367 | #endif // QT_CONFIG(tabletevent) |
368 | |
369 | #if QT_CONFIG(gestures) |
370 | class Q_GUI_EXPORT QNativeGestureEvent : public QSinglePointEvent |
371 | { |
372 | Q_DECL_EVENT_COMMON(QNativeGestureEvent) |
373 | public: |
374 | #if QT_DEPRECATED_SINCE(6, 2) |
375 | QT_DEPRECATED_VERSION_X_6_2("Use the other constructor") |
376 | QNativeGestureEvent(Qt::NativeGestureType type, const QPointingDevice *dev, const QPointF &localPos, const QPointF &scenePos, |
377 | const QPointF &globalPos, qreal value, quint64 sequenceId, quint64 intArgument); |
378 | #endif |
379 | QNativeGestureEvent(Qt::NativeGestureType type, const QPointingDevice *dev, int fingerCount, |
380 | const QPointF &localPos, const QPointF &scenePos, const QPointF &globalPos, |
381 | qreal value, const QPointF &delta, quint64 sequenceId = UINT64_MAX); |
382 | |
383 | Qt::NativeGestureType gestureType() const { return m_gestureType; } |
384 | int fingerCount() const { return m_fingerCount; } |
385 | qreal value() const { return m_realValue; } |
386 | QPointF delta() const { |
387 | #if QT_VERSION < QT_VERSION_CHECK(7, 0, 0) |
388 | return m_delta.toPointF(); |
389 | #else |
390 | return m_delta; |
391 | #endif |
392 | } |
393 | |
394 | #if QT_DEPRECATED_SINCE(6, 0) |
395 | #ifndef QT_NO_INTEGER_EVENT_COORDINATES |
396 | QT_DEPRECATED_VERSION_X_6_0("Use position().toPoint()") |
397 | inline const QPoint pos() const { return position().toPoint(); } |
398 | QT_DEPRECATED_VERSION_X_6_0("Use globalPosition().toPoint()") |
399 | inline const QPoint globalPos() const { return globalPosition().toPoint(); } |
400 | #endif |
401 | QT_DEPRECATED_VERSION_X_6_0("Use position()") |
402 | QPointF localPos() const { return position(); } |
403 | QT_DEPRECATED_VERSION_X_6_0("Use scenePosition()") |
404 | QPointF windowPos() const { return scenePosition(); } |
405 | QT_DEPRECATED_VERSION_X_6_0("Use globalPosition()") |
406 | QPointF screenPos() const { return globalPosition(); } |
407 | #endif |
408 | |
409 | protected: |
410 | quint64 m_sequenceId; |
411 | #if QT_VERSION < QT_VERSION_CHECK(7, 0, 0) |
412 | QVector2D m_delta; |
413 | #else |
414 | QPointF m_delta; |
415 | #endif |
416 | qreal m_realValue; |
417 | Qt::NativeGestureType m_gestureType; |
418 | quint32 m_fingerCount : 4; |
419 | quint32 m_reserved : 28; |
420 | }; |
421 | #endif // QT_CONFIG(gestures) |
422 | |
423 | class Q_GUI_EXPORT QKeyEvent : public QInputEvent |
424 | { |
425 | Q_DECL_EVENT_COMMON(QKeyEvent) |
426 | public: |
427 | QKeyEvent(Type type, int key, Qt::KeyboardModifiers modifiers, const QString& text = QString(), |
428 | bool autorep = false, quint16 count = 1); |
429 | QKeyEvent(Type type, int key, Qt::KeyboardModifiers modifiers, |
430 | quint32 nativeScanCode, quint32 nativeVirtualKey, quint32 nativeModifiers, |
431 | const QString &text = QString(), bool autorep = false, quint16 count = 1, |
432 | const QInputDevice *device = QInputDevice::primaryKeyboard()); |
433 | |
434 | int key() const { return m_key; } |
435 | #if QT_CONFIG(shortcut) |
436 | bool matches(QKeySequence::StandardKey key) const; |
437 | #endif |
438 | Qt::KeyboardModifiers modifiers() const; |
439 | QKeyCombination keyCombination() const |
440 | { |
441 | return QKeyCombination(modifiers(), Qt::Key(m_key)); |
442 | } |
443 | inline QString text() const { return m_text; } |
444 | inline bool isAutoRepeat() const { return m_autoRepeat; } |
445 | inline int count() const { return int(m_count); } |
446 | |
447 | inline quint32 nativeScanCode() const { return m_scanCode; } |
448 | inline quint32 nativeVirtualKey() const { return m_virtualKey; } |
449 | inline quint32 nativeModifiers() const { return m_nativeModifiers; } |
450 | |
451 | #if QT_CONFIG(shortcut) |
452 | friend inline bool operator==(QKeyEvent *e, QKeySequence::StandardKey key) |
453 | { return (e ? e->matches(key) : false); } |
454 | friend inline bool operator==(QKeySequence::StandardKey key, QKeyEvent *e) |
455 | { return (e ? e->matches(key) : false); } |
456 | #endif // QT_CONFIG(shortcut) |
457 | |
458 | protected: |
459 | QString m_text; |
460 | int m_key; |
461 | quint32 m_scanCode; |
462 | quint32 m_virtualKey; |
463 | quint32 m_nativeModifiers; |
464 | quint16 m_count : 15; |
465 | quint16 m_autoRepeat : 1; |
466 | }; |
467 | |
468 | |
469 | class Q_GUI_EXPORT QFocusEvent : public QEvent |
470 | { |
471 | Q_DECL_EVENT_COMMON(QFocusEvent) |
472 | public: |
473 | explicit QFocusEvent(Type type, Qt::FocusReason reason=Qt::OtherFocusReason); |
474 | |
475 | inline bool gotFocus() const { return type() == FocusIn; } |
476 | inline bool lostFocus() const { return type() == FocusOut; } |
477 | |
478 | Qt::FocusReason reason() const; |
479 | |
480 | private: |
481 | Qt::FocusReason m_reason; |
482 | }; |
483 | |
484 | |
485 | class Q_GUI_EXPORT QPaintEvent : public QEvent |
486 | { |
487 | Q_DECL_EVENT_COMMON(QPaintEvent) |
488 | public: |
489 | explicit QPaintEvent(const QRegion& paintRegion); |
490 | explicit QPaintEvent(const QRect &paintRect); |
491 | |
492 | inline const QRect &rect() const { return m_rect; } |
493 | inline const QRegion ®ion() const { return m_region; } |
494 | |
495 | protected: |
496 | QRect m_rect; |
497 | QRegion m_region; |
498 | bool m_erased; |
499 | }; |
500 | |
501 | class Q_GUI_EXPORT QMoveEvent : public QEvent |
502 | { |
503 | Q_DECL_EVENT_COMMON(QMoveEvent) |
504 | public: |
505 | QMoveEvent(const QPoint &pos, const QPoint &oldPos); |
506 | |
507 | inline const QPoint &pos() const { return m_pos; } |
508 | inline const QPoint &oldPos() const { return m_oldPos;} |
509 | protected: |
510 | QPoint m_pos, m_oldPos; |
511 | friend class QApplication; |
512 | }; |
513 | |
514 | class Q_GUI_EXPORT QExposeEvent : public QEvent |
515 | { |
516 | Q_DECL_EVENT_COMMON(QExposeEvent) |
517 | public: |
518 | explicit QExposeEvent(const QRegion &m_region); |
519 | |
520 | #if QT_DEPRECATED_SINCE(6, 0) |
521 | QT_DEPRECATED_VERSION_X_6_0("Handle QPaintEvent instead") |
522 | inline const QRegion ®ion() const { return m_region; } |
523 | #endif |
524 | |
525 | protected: |
526 | QRegion m_region; |
527 | friend class QWidgetWindow; |
528 | }; |
529 | |
530 | class Q_GUI_EXPORT QPlatformSurfaceEvent : public QEvent |
531 | { |
532 | Q_DECL_EVENT_COMMON(QPlatformSurfaceEvent) |
533 | public: |
534 | enum SurfaceEventType { |
535 | SurfaceCreated, |
536 | SurfaceAboutToBeDestroyed |
537 | }; |
538 | |
539 | explicit QPlatformSurfaceEvent(SurfaceEventType surfaceEventType); |
540 | |
541 | inline SurfaceEventType surfaceEventType() const { return m_surfaceEventType; } |
542 | |
543 | protected: |
544 | SurfaceEventType m_surfaceEventType; |
545 | }; |
546 | |
547 | class Q_GUI_EXPORT QResizeEvent : public QEvent |
548 | { |
549 | Q_DECL_EVENT_COMMON(QResizeEvent) |
550 | public: |
551 | QResizeEvent(const QSize &size, const QSize &oldSize); |
552 | |
553 | inline const QSize &size() const { return m_size; } |
554 | inline const QSize &oldSize()const { return m_oldSize;} |
555 | protected: |
556 | QSize m_size, m_oldSize; |
557 | friend class QApplication; |
558 | }; |
559 | |
560 | |
561 | class Q_GUI_EXPORT QCloseEvent : public QEvent |
562 | { |
563 | Q_DECL_EVENT_COMMON(QCloseEvent) |
564 | public: |
565 | QCloseEvent(); |
566 | }; |
567 | |
568 | |
569 | class Q_GUI_EXPORT QIconDragEvent : public QEvent |
570 | { |
571 | Q_DECL_EVENT_COMMON(QIconDragEvent) |
572 | public: |
573 | QIconDragEvent(); |
574 | }; |
575 | |
576 | |
577 | class Q_GUI_EXPORT QShowEvent : public QEvent |
578 | { |
579 | Q_DECL_EVENT_COMMON(QShowEvent) |
580 | public: |
581 | QShowEvent(); |
582 | }; |
583 | |
584 | |
585 | class Q_GUI_EXPORT QHideEvent : public QEvent |
586 | { |
587 | Q_DECL_EVENT_COMMON(QHideEvent) |
588 | public: |
589 | QHideEvent(); |
590 | }; |
591 | |
592 | #ifndef QT_NO_CONTEXTMENU |
593 | class Q_GUI_EXPORT QContextMenuEvent : public QInputEvent |
594 | { |
595 | Q_DECL_EVENT_COMMON(QContextMenuEvent) |
596 | public: |
597 | enum Reason { Mouse, Keyboard, Other }; |
598 | |
599 | QContextMenuEvent(Reason reason, const QPoint &pos, const QPoint &globalPos, |
600 | Qt::KeyboardModifiers modifiers = Qt::NoModifier); |
601 | #if QT_DEPRECATED_SINCE(6, 4) |
602 | QT_DEPRECATED_VERSION_X_6_4("Use the other constructor") |
603 | QContextMenuEvent(Reason reason, const QPoint &pos); |
604 | #endif |
605 | |
606 | inline int x() const { return m_pos.x(); } |
607 | inline int y() const { return m_pos.y(); } |
608 | inline int globalX() const { return m_globalPos.x(); } |
609 | inline int globalY() const { return m_globalPos.y(); } |
610 | |
611 | inline const QPoint& pos() const { return m_pos; } |
612 | inline const QPoint& globalPos() const { return m_globalPos; } |
613 | |
614 | inline Reason reason() const { return Reason(m_reason); } |
615 | |
616 | protected: |
617 | QPoint m_pos; |
618 | QPoint m_globalPos; |
619 | uint m_reason : 8; |
620 | }; |
621 | #endif // QT_NO_CONTEXTMENU |
622 | |
623 | #ifndef QT_NO_INPUTMETHOD |
624 | class Q_GUI_EXPORT QInputMethodEvent : public QEvent |
625 | { |
626 | Q_DECL_EVENT_COMMON(QInputMethodEvent) |
627 | public: |
628 | enum AttributeType { |
629 | TextFormat, |
630 | Cursor, |
631 | Language, |
632 | Ruby, |
633 | Selection |
634 | }; |
635 | class Attribute { |
636 | public: |
637 | Attribute(AttributeType typ, int s, int l, QVariant val) : type(typ), start(s), length(l), value(std::move(val)) {} |
638 | Attribute(AttributeType typ, int s, int l) : type(typ), start(s), length(l), value() {} |
639 | |
640 | AttributeType type; |
641 | int start; |
642 | int length; |
643 | QVariant value; |
644 | }; |
645 | QInputMethodEvent(); |
646 | QInputMethodEvent(const QString &preeditText, const QList<Attribute> &attributes); |
647 | |
648 | void setCommitString(const QString &commitString, int replaceFrom = 0, int replaceLength = 0); |
649 | inline const QList<Attribute> &attributes() const { return m_attributes; } |
650 | inline const QString &preeditString() const { return m_preedit; } |
651 | |
652 | inline const QString &commitString() const { return m_commit; } |
653 | inline int replacementStart() const { return m_replacementStart; } |
654 | inline int replacementLength() const { return m_replacementLength; } |
655 | |
656 | inline friend bool operator==(const QInputMethodEvent::Attribute &lhs, |
657 | const QInputMethodEvent::Attribute &rhs) |
658 | { |
659 | return lhs.type == rhs.type && lhs.start == rhs.start |
660 | && lhs.length == rhs.length && lhs.value == rhs.value; |
661 | } |
662 | |
663 | inline friend bool operator!=(const QInputMethodEvent::Attribute &lhs, |
664 | const QInputMethodEvent::Attribute &rhs) |
665 | { |
666 | return !(lhs == rhs); |
667 | } |
668 | |
669 | private: |
670 | QString m_preedit; |
671 | QString m_commit; |
672 | QList<Attribute> m_attributes; |
673 | int m_replacementStart; |
674 | int m_replacementLength; |
675 | }; |
676 | Q_DECLARE_TYPEINFO(QInputMethodEvent::Attribute, Q_RELOCATABLE_TYPE); |
677 | |
678 | class Q_GUI_EXPORT QInputMethodQueryEvent : public QEvent |
679 | { |
680 | Q_DECL_EVENT_COMMON(QInputMethodQueryEvent) |
681 | public: |
682 | explicit QInputMethodQueryEvent(Qt::InputMethodQueries queries); |
683 | |
684 | Qt::InputMethodQueries queries() const { return m_queries; } |
685 | |
686 | void setValue(Qt::InputMethodQuery query, const QVariant &value); |
687 | QVariant value(Qt::InputMethodQuery query) const; |
688 | private: |
689 | Qt::InputMethodQueries m_queries; |
690 | struct QueryPair { |
691 | Qt::InputMethodQuery query; |
692 | QVariant value; |
693 | }; |
694 | friend QTypeInfo<QueryPair>; |
695 | QList<QueryPair> m_values; |
696 | }; |
697 | Q_DECLARE_TYPEINFO(QInputMethodQueryEvent::QueryPair, Q_RELOCATABLE_TYPE); |
698 | |
699 | #endif // QT_NO_INPUTMETHOD |
700 | |
701 | #if QT_CONFIG(draganddrop) |
702 | |
703 | class QMimeData; |
704 | |
705 | class Q_GUI_EXPORT QDropEvent : public QEvent |
706 | { |
707 | Q_DECL_EVENT_COMMON(QDropEvent) |
708 | public: |
709 | QDropEvent(const QPointF& pos, Qt::DropActions actions, const QMimeData *data, |
710 | Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Type type = Drop); |
711 | |
712 | #if QT_DEPRECATED_SINCE(6, 0) |
713 | QT_DEPRECATED_VERSION_X_6_0("Use position().toPoint()") |
714 | inline QPoint pos() const { return position().toPoint(); } |
715 | QT_DEPRECATED_VERSION_X_6_0("Use position()") |
716 | inline QPointF posF() const { return position(); } |
717 | QT_DEPRECATED_VERSION_X_6_0("Use buttons()") |
718 | inline Qt::MouseButtons mouseButtons() const { return buttons(); } |
719 | QT_DEPRECATED_VERSION_X_6_0("Use modifiers()") |
720 | inline Qt::KeyboardModifiers keyboardModifiers() const { return modifiers(); } |
721 | #endif // QT_DEPRECATED_SINCE(6, 0) |
722 | |
723 | QPointF position() const { return m_pos; } |
724 | inline Qt::MouseButtons buttons() const { return m_mouseState; } |
725 | inline Qt::KeyboardModifiers modifiers() const { return m_modState; } |
726 | |
727 | inline Qt::DropActions possibleActions() const { return m_actions; } |
728 | inline Qt::DropAction proposedAction() const { return m_defaultAction; } |
729 | inline void acceptProposedAction() { m_dropAction = m_defaultAction; accept(); } |
730 | |
731 | inline Qt::DropAction dropAction() const { return m_dropAction; } |
732 | void setDropAction(Qt::DropAction action); |
733 | |
734 | QObject* source() const; |
735 | inline const QMimeData *mimeData() const { return m_data; } |
736 | |
737 | protected: |
738 | friend class QApplication; |
739 | QPointF m_pos; |
740 | Qt::MouseButtons m_mouseState; |
741 | Qt::KeyboardModifiers m_modState; |
742 | Qt::DropActions m_actions; |
743 | Qt::DropAction m_dropAction; |
744 | Qt::DropAction m_defaultAction; |
745 | const QMimeData *m_data; |
746 | }; |
747 | |
748 | |
749 | class Q_GUI_EXPORT QDragMoveEvent : public QDropEvent |
750 | { |
751 | Q_DECL_EVENT_COMMON(QDragMoveEvent) |
752 | public: |
753 | QDragMoveEvent(const QPoint &pos, Qt::DropActions actions, const QMimeData *data, |
754 | Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Type type = DragMove); |
755 | |
756 | inline QRect answerRect() const { return m_rect; } |
757 | |
758 | inline void accept() { QDropEvent::accept(); } |
759 | inline void ignore() { QDropEvent::ignore(); } |
760 | |
761 | inline void accept(const QRect & r) { accept(); m_rect = r; } |
762 | inline void ignore(const QRect & r) { ignore(); m_rect = r; } |
763 | |
764 | protected: |
765 | QRect m_rect; |
766 | }; |
767 | |
768 | |
769 | class Q_GUI_EXPORT QDragEnterEvent : public QDragMoveEvent |
770 | { |
771 | Q_DECL_EVENT_COMMON(QDragEnterEvent) |
772 | public: |
773 | QDragEnterEvent(const QPoint &pos, Qt::DropActions actions, const QMimeData *data, |
774 | Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers); |
775 | }; |
776 | |
777 | |
778 | class Q_GUI_EXPORT QDragLeaveEvent : public QEvent |
779 | { |
780 | Q_DECL_EVENT_COMMON(QDragLeaveEvent) |
781 | public: |
782 | QDragLeaveEvent(); |
783 | }; |
784 | #endif // QT_CONFIG(draganddrop) |
785 | |
786 | |
787 | class Q_GUI_EXPORT QHelpEvent : public QEvent |
788 | { |
789 | Q_DECL_EVENT_COMMON(QHelpEvent) |
790 | public: |
791 | QHelpEvent(Type type, const QPoint &pos, const QPoint &globalPos); |
792 | |
793 | inline int x() const { return m_pos.x(); } |
794 | inline int y() const { return m_pos.y(); } |
795 | inline int globalX() const { return m_globalPos.x(); } |
796 | inline int globalY() const { return m_globalPos.y(); } |
797 | |
798 | inline const QPoint& pos() const { return m_pos; } |
799 | inline const QPoint& globalPos() const { return m_globalPos; } |
800 | |
801 | private: |
802 | QPoint m_pos; |
803 | QPoint m_globalPos; |
804 | }; |
805 | |
806 | #ifndef QT_NO_STATUSTIP |
807 | class Q_GUI_EXPORT QStatusTipEvent : public QEvent |
808 | { |
809 | Q_DECL_EVENT_COMMON(QStatusTipEvent) |
810 | public: |
811 | explicit QStatusTipEvent(const QString &tip); |
812 | |
813 | inline QString tip() const { return m_tip; } |
814 | private: |
815 | QString m_tip; |
816 | }; |
817 | #endif |
818 | |
819 | #if QT_CONFIG(whatsthis) |
820 | class Q_GUI_EXPORT QWhatsThisClickedEvent : public QEvent |
821 | { |
822 | Q_DECL_EVENT_COMMON(QWhatsThisClickedEvent) |
823 | public: |
824 | explicit QWhatsThisClickedEvent(const QString &href); |
825 | |
826 | inline QString href() const { return m_href; } |
827 | private: |
828 | QString m_href; |
829 | }; |
830 | #endif |
831 | |
832 | #if QT_CONFIG(action) |
833 | class Q_GUI_EXPORT QActionEvent : public QEvent |
834 | { |
835 | Q_DECL_EVENT_COMMON(QActionEvent) |
836 | public: |
837 | QActionEvent(int type, QAction *action, QAction *before = nullptr); |
838 | |
839 | inline QAction *action() const { return m_action; } |
840 | inline QAction *before() const { return m_before; } |
841 | private: |
842 | QAction *m_action; |
843 | QAction *m_before; |
844 | }; |
845 | #endif // QT_CONFIG(action) |
846 | |
847 | class Q_GUI_EXPORT QFileOpenEvent : public QEvent |
848 | { |
849 | Q_DECL_EVENT_COMMON(QFileOpenEvent) |
850 | public: |
851 | explicit QFileOpenEvent(const QString &file); |
852 | explicit QFileOpenEvent(const QUrl &url); |
853 | |
854 | inline QString file() const { return m_file; } |
855 | QUrl url() const { return m_url; } |
856 | #if QT_DEPRECATED_SINCE(6, 6) |
857 | QT_DEPRECATED_VERSION_X_6_6("Interpret the string returned by file()") |
858 | bool openFile(QFile &file, QIODevice::OpenMode flags) const; |
859 | #endif |
860 | private: |
861 | QString m_file; |
862 | QUrl m_url; |
863 | }; |
864 | |
865 | #ifndef QT_NO_TOOLBAR |
866 | class Q_GUI_EXPORT QToolBarChangeEvent : public QEvent |
867 | { |
868 | Q_DECL_EVENT_COMMON(QToolBarChangeEvent) |
869 | public: |
870 | explicit QToolBarChangeEvent(bool t); |
871 | |
872 | inline bool toggle() const { return m_toggle; } |
873 | private: |
874 | bool m_toggle; |
875 | }; |
876 | #endif |
877 | |
878 | #if QT_CONFIG(shortcut) |
879 | class Q_GUI_EXPORT QShortcutEvent : public QEvent |
880 | { |
881 | Q_DECL_EVENT_COMMON(QShortcutEvent) |
882 | public: |
883 | // Note this is publicly deprecated, but should remain as internal constructor: |
884 | QShortcutEvent(const QKeySequence &key, int id, bool ambiguous = false); |
885 | QShortcutEvent(const QKeySequence &key, const QShortcut *shortcut = nullptr, bool ambiguous = false); |
886 | |
887 | inline const QKeySequence &key() const { return m_sequence; } |
888 | // Note this is publicly deprecated, but should remain as internal getter: |
889 | inline int shortcutId() const { return m_shortcutId; } |
890 | inline bool isAmbiguous() const { return m_ambiguous; } |
891 | protected: |
892 | QKeySequence m_sequence; |
893 | int m_shortcutId; |
894 | bool m_ambiguous; |
895 | }; |
896 | #endif |
897 | |
898 | class Q_GUI_EXPORT QWindowStateChangeEvent: public QEvent |
899 | { |
900 | Q_DECL_EVENT_COMMON(QWindowStateChangeEvent) |
901 | public: |
902 | explicit QWindowStateChangeEvent(Qt::WindowStates oldState, bool isOverride = false); |
903 | |
904 | inline Qt::WindowStates oldState() const { return m_oldStates; } |
905 | bool isOverride() const; |
906 | |
907 | private: |
908 | Qt::WindowStates m_oldStates; |
909 | bool m_override; |
910 | }; |
911 | |
912 | #ifndef QT_NO_DEBUG_STREAM |
913 | Q_GUI_EXPORT QDebug operator<<(QDebug, const QEvent *); |
914 | #endif |
915 | |
916 | class Q_GUI_EXPORT QTouchEvent : public QPointerEvent |
917 | { |
918 | Q_DECL_EVENT_COMMON(QTouchEvent) |
919 | public: |
920 | using TouchPoint = QEventPoint; // source compat |
921 | |
922 | explicit QTouchEvent(QEvent::Type eventType, |
923 | const QPointingDevice *device = nullptr, |
924 | Qt::KeyboardModifiers modifiers = Qt::NoModifier, |
925 | const QList<QEventPoint> &touchPoints = {}); |
926 | #if QT_DEPRECATED_SINCE(6, 0) |
927 | QT_DEPRECATED_VERSION_X_6_0("Use another constructor") |
928 | explicit QTouchEvent(QEvent::Type eventType, |
929 | const QPointingDevice *device, |
930 | Qt::KeyboardModifiers modifiers, |
931 | QEventPoint::States touchPointStates, |
932 | const QList<QEventPoint> &touchPoints = {}); |
933 | #endif |
934 | |
935 | inline QObject *target() const { return m_target; } |
936 | inline QEventPoint::States touchPointStates() const { return m_touchPointStates; } |
937 | #if QT_DEPRECATED_SINCE(6, 0) |
938 | QT_DEPRECATED_VERSION_X_6_0("Use points()") |
939 | const QList<QEventPoint> &touchPoints() const { return points(); } |
940 | #endif |
941 | bool isBeginEvent() const override; |
942 | bool isUpdateEvent() const override; |
943 | bool isEndEvent() const override; |
944 | |
945 | protected: |
946 | QObject *m_target = nullptr; |
947 | QEventPoint::States m_touchPointStates = QEventPoint::State::Unknown; |
948 | quint32 m_reserved : 24; |
949 | }; |
950 | |
951 | class Q_GUI_EXPORT QScrollPrepareEvent : public QEvent |
952 | { |
953 | Q_DECL_EVENT_COMMON(QScrollPrepareEvent) |
954 | public: |
955 | explicit QScrollPrepareEvent(const QPointF &startPos); |
956 | |
957 | QPointF startPos() const { return m_startPos; } |
958 | |
959 | QSizeF viewportSize() const { return m_viewportSize; } |
960 | QRectF contentPosRange() const { return m_contentPosRange; } |
961 | QPointF contentPos() const { return m_contentPos; } |
962 | |
963 | void setViewportSize(const QSizeF &size); |
964 | void setContentPosRange(const QRectF &rect); |
965 | void setContentPos(const QPointF &pos); |
966 | |
967 | private: |
968 | QRectF m_contentPosRange; |
969 | QSizeF m_viewportSize; |
970 | QPointF m_startPos; |
971 | QPointF m_contentPos; |
972 | }; |
973 | |
974 | |
975 | class Q_GUI_EXPORT QScrollEvent : public QEvent |
976 | { |
977 | Q_DECL_EVENT_COMMON(QScrollEvent) |
978 | public: |
979 | enum ScrollState |
980 | { |
981 | ScrollStarted, |
982 | ScrollUpdated, |
983 | ScrollFinished |
984 | }; |
985 | |
986 | QScrollEvent(const QPointF &contentPos, const QPointF &overshoot, ScrollState scrollState); |
987 | |
988 | QPointF contentPos() const { return m_contentPos; } |
989 | QPointF overshootDistance() const { return m_overshoot; } |
990 | ScrollState scrollState() const { return m_state; } |
991 | |
992 | private: |
993 | QPointF m_contentPos; |
994 | QPointF m_overshoot; |
995 | QScrollEvent::ScrollState m_state; |
996 | }; |
997 | |
998 | class Q_GUI_EXPORT QScreenOrientationChangeEvent : public QEvent |
999 | { |
1000 | Q_DECL_EVENT_COMMON(QScreenOrientationChangeEvent) |
1001 | public: |
1002 | QScreenOrientationChangeEvent(QScreen *screen, Qt::ScreenOrientation orientation); |
1003 | |
1004 | QScreen *screen() const { return m_screen; } |
1005 | Qt::ScreenOrientation orientation() const { return m_orientation; } |
1006 | |
1007 | private: |
1008 | QScreen *m_screen; |
1009 | Qt::ScreenOrientation m_orientation; |
1010 | }; |
1011 | |
1012 | class Q_GUI_EXPORT QApplicationStateChangeEvent : public QEvent |
1013 | { |
1014 | Q_DECL_EVENT_COMMON(QApplicationStateChangeEvent) |
1015 | public: |
1016 | explicit QApplicationStateChangeEvent(Qt::ApplicationState state); |
1017 | |
1018 | Qt::ApplicationState applicationState() const { return m_applicationState; } |
1019 | |
1020 | private: |
1021 | Qt::ApplicationState m_applicationState; |
1022 | }; |
1023 | |
1024 | class Q_GUI_EXPORT QChildWindowEvent : public QEvent |
1025 | { |
1026 | Q_DECL_EVENT_COMMON(QChildWindowEvent) |
1027 | public: |
1028 | explicit QChildWindowEvent(Type type, QWindow *childWindow); |
1029 | QWindow *child() const { return c; } |
1030 | |
1031 | private: |
1032 | QWindow *c; |
1033 | }; |
1034 | |
1035 | QT_END_NAMESPACE |
1036 | |
1037 | #endif // QEVENT_H |
1038 |
Definitions
- QInputEvent
- device
- deviceType
- modifiers
- setModifiers
- timestamp
- setTimestamp
- QPointerEvent
- pointerType
- pointCount
- points
- isBeginEvent
- isUpdateEvent
- isEndEvent
- QSinglePointEvent
- button
- buttons
- position
- scenePosition
- globalPosition
- exclusivePointGrabber
- setExclusivePointGrabber
- QEnterEvent
- localPos
- windowPos
- screenPos
- QMouseEvent
- localPos
- windowPos
- screenPos
- QHoverEvent
- posF
- isUpdateEvent
- oldPos
- oldPosF
- QWheelEvent
- pixelDelta
- angleDelta
- phase
- inverted
- isInverted
- hasPixelDelta
- source
- QTabletEvent
- pos
- globalPos
- posF
- globalPosF
- x
- y
- globalX
- globalY
- hiResGlobalX
- hiResGlobalY
- uniqueId
- pressure
- rotation
- z
- tangentialPressure
- xTilt
- yTilt
- QNativeGestureEvent
- gestureType
- fingerCount
- value
- delta
- localPos
- windowPos
- screenPos
- QKeyEvent
- key
- keyCombination
- text
- isAutoRepeat
- count
- nativeScanCode
- nativeVirtualKey
- nativeModifiers
- operator==
- operator==
- QFocusEvent
- gotFocus
- lostFocus
- QPaintEvent
- rect
- region
- QMoveEvent
- pos
- oldPos
- QExposeEvent
- region
- QPlatformSurfaceEvent
- SurfaceEventType
- surfaceEventType
- QResizeEvent
- size
- oldSize
- QCloseEvent
- QIconDragEvent
- QShowEvent
- QHideEvent
- QContextMenuEvent
- Reason
- x
- y
- globalX
- globalY
- pos
- globalPos
- reason
- QInputMethodEvent
- AttributeType
- Attribute
- Attribute
- Attribute
- attributes
- preeditString
- commitString
- replacementStart
- replacementLength
- operator==
- operator!=
- QInputMethodQueryEvent
- queries
- QueryPair
- QDropEvent
- pos
- posF
- mouseButtons
- keyboardModifiers
- position
- buttons
- modifiers
- possibleActions
- proposedAction
- acceptProposedAction
- dropAction
- mimeData
- QDragMoveEvent
- answerRect
- accept
- ignore
- accept
- ignore
- QDragEnterEvent
- QDragLeaveEvent
- QHelpEvent
- x
- y
- globalX
- globalY
- pos
- globalPos
- QStatusTipEvent
- tip
- QWhatsThisClickedEvent
- href
- QActionEvent
- action
- before
- QFileOpenEvent
- file
- url
- QToolBarChangeEvent
- toggle
- QShortcutEvent
- key
- shortcutId
- isAmbiguous
- QWindowStateChangeEvent
- oldState
- QTouchEvent
- target
- touchPointStates
- touchPoints
- QScrollPrepareEvent
- startPos
- viewportSize
- contentPosRange
- contentPos
- QScrollEvent
- ScrollState
- contentPos
- overshootDistance
- scrollState
- QScreenOrientationChangeEvent
- screen
- orientation
- QApplicationStateChangeEvent
- applicationState
- QChildWindowEvent
Start learning QML with our Intro Training
Find out more