Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qevent.h
Go to the documentation of this file.
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
29class tst_QEvent;
30
32
33class QFile;
34class QAction;
35class QMouseEvent;
36template <typename T> class QPointer;
37class QPointerEvent;
38class QScreen;
39#if QT_CONFIG(shortcut)
40class QShortcut;
41#endif
42class QTabletEvent;
43class QTouchEvent;
44#if QT_CONFIG(gestures)
45class QGesture;
46#endif
47
48class Q_GUI_EXPORT QInputEvent : public QEvent
49{
51public:
52 explicit QInputEvent(Type type, const QInputDevice *m_dev, Qt::KeyboardModifiers modifiers = Qt::NoModifier);
53
54 const QInputDevice *device() const { return m_dev; }
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
61protected:
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
72class Q_GUI_EXPORT QPointerEvent : public QInputEvent
73{
76public:
77 explicit QPointerEvent(Type type, const QPointingDevice *dev,
78 Qt::KeyboardModifiers modifiers = Qt::NoModifier, const QList<QEventPoint> &points = {});
79
80 const QPointingDevice *pointingDevice() 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
102protected:
104
105 QList<QEventPoint> m_points;
106};
107
108class Q_GUI_EXPORT QSinglePointEvent : public QPointerEvent
109{
111 Q_PROPERTY(QObject *exclusivePointGrabber READ exclusivePointGrabber
112 WRITE setExclusivePointGrabber)
113
115public:
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
132 void setExclusivePointGrabber(QObject *exclusiveGrabber)
133 { QPointerEvent::setExclusiveGrabber(points().first(), exclusiveGrabber); }
134
135protected:
136 friend class ::tst_QEvent;
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,
145
147 Qt::MouseButtons m_mouseState = Qt::NoButton;
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
157 // for QMouseEvent
159 // for QWheelEvent
162};
163
164class Q_GUI_EXPORT QEnterEvent : public QSinglePointEvent
165{
167public:
168 QEnterEvent(const QPointF &localPos, const QPointF &scenePos, const QPointF &globalPos,
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
195class Q_GUI_EXPORT QMouseEvent : public QSinglePointEvent
196{
198public:
199#if QT_DEPRECATED_SINCE(6, 4)
200 QT_DEPRECATED_VERSION_X_6_4("Use another constructor")
202 Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers,
204#endif
205 QMouseEvent(Type type, const QPointF &localPos, const QPointF &globalPos,
206 Qt::MouseButton button, Qt::MouseButtons buttons,
207 Qt::KeyboardModifiers modifiers,
209 QMouseEvent(Type type, const QPointF &localPos, const QPointF &scenePos, const QPointF &globalPos,
210 Qt::MouseButton button, Qt::MouseButtons buttons,
211 Qt::KeyboardModifiers modifiers,
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,
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)
242 Qt::MouseEventFlags flags() const;
243};
244
245class Q_GUI_EXPORT QHoverEvent : public QSinglePointEvent
246{
248public:
249 QHoverEvent(Type type, const QPointF &scenePos, const QPointF &globalPos, const QPointF &oldPos,
250 Qt::KeyboardModifiers modifiers = Qt::NoModifier,
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,
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
275protected:
276 QPointF m_oldPos; // TODO remove?
277};
278
279#if QT_CONFIG(wheelevent)
280class Q_GUI_EXPORT QWheelEvent : public QSinglePointEvent
281{
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)
290public:
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,
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
311protected:
312 QPoint m_pixelDelta;
313 QPoint m_angleDelta;
314};
315#endif
316
317#if QT_CONFIG(tabletevent)
318class Q_GUI_EXPORT QTabletEvent : public QSinglePointEvent
319{
320 Q_DECL_EVENT_COMMON(QTabletEvent)
321public:
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(position().x()); }
341 QT_DEPRECATED_VERSION_X_6_0("Use position().y()")
342 inline int y() const { return qRound(position().y()); }
343 QT_DEPRECATED_VERSION_X_6_0("Use globalPosition().x()")
344 inline int globalX() const { return qRound(globalPosition().x()); }
345 QT_DEPRECATED_VERSION_X_6_0("Use globalPosition().y()")
346 inline int globalY() const { return qRound(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
361protected:
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)
370class Q_GUI_EXPORT QNativeGestureEvent : public QSinglePointEvent
371{
373public:
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
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
409protected:
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
423class Q_GUI_EXPORT QKeyEvent : public QInputEvent
424{
426public:
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,
433
434 int key() const { return m_key; }
435#if QT_CONFIG(shortcut)
437#endif
438 Qt::KeyboardModifiers modifiers() 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
458protected:
460 int m_key;
466};
467
468
469class Q_GUI_EXPORT QFocusEvent : public QEvent
470{
472public:
474
475 inline bool gotFocus() const { return type() == FocusIn; }
476 inline bool lostFocus() const { return type() == FocusOut; }
477
478 Qt::FocusReason reason() const;
479
480private:
481 Qt::FocusReason m_reason;
482};
483
484
485class Q_GUI_EXPORT QPaintEvent : public QEvent
486{
488public:
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 &region() const { return m_region; }
494
495protected:
499};
500
501class Q_GUI_EXPORT QMoveEvent : public QEvent
502{
504public:
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;}
509protected:
511 friend class QApplication;
512};
513
514class Q_GUI_EXPORT QExposeEvent : public QEvent
515{
517public:
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 &region() const { return m_region; }
523#endif
524
525protected:
527 friend class QWidgetWindow;
528};
529
530class Q_GUI_EXPORT QPlatformSurfaceEvent : public QEvent
531{
533public:
536 SurfaceAboutToBeDestroyed
537 };
538
539 explicit QPlatformSurfaceEvent(SurfaceEventType surfaceEventType);
540
541 inline SurfaceEventType surfaceEventType() const { return m_surfaceEventType; }
542
543protected:
545};
546
547class Q_GUI_EXPORT QResizeEvent : public QEvent
548{
550public:
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;}
555protected:
557 friend class QApplication;
558};
559
560
561class Q_GUI_EXPORT QCloseEvent : public QEvent
562{
564public:
565 QCloseEvent();
566};
567
568
569class Q_GUI_EXPORT QIconDragEvent : public QEvent
570{
572public:
574};
575
576
577class Q_GUI_EXPORT QShowEvent : public QEvent
578{
580public:
581 QShowEvent();
582};
583
584
585class Q_GUI_EXPORT QHideEvent : public QEvent
586{
588public:
589 QHideEvent();
590};
591
592#ifndef QT_NO_CONTEXTMENU
593class Q_GUI_EXPORT QContextMenuEvent : public QInputEvent
594{
596public:
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
616protected:
620};
621#endif // QT_NO_CONTEXTMENU
622
623#ifndef QT_NO_INPUTMETHOD
624class Q_GUI_EXPORT QInputMethodEvent : public QEvent
625{
627public:
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
641 int start;
644 };
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,
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,
665 {
666 return !(lhs == rhs);
667 }
668
669private:
670 QString m_preedit;
671 QString m_commit;
672 QList<Attribute> m_attributes;
673 int m_replacementStart;
674 int m_replacementLength;
675};
677
678class Q_GUI_EXPORT QInputMethodQueryEvent : public QEvent
679{
681public:
682 explicit QInputMethodQueryEvent(Qt::InputMethodQueries queries);
683
684 Qt::InputMethodQueries queries() const { return m_queries; }
685
688private:
689 Qt::InputMethodQueries m_queries;
690 struct QueryPair {
693 };
694 friend QTypeInfo<QueryPair>;
695 QList<QueryPair> m_values;
696};
697Q_DECLARE_TYPEINFO(QInputMethodQueryEvent::QueryPair, Q_RELOCATABLE_TYPE);
698
699#endif // QT_NO_INPUTMETHOD
700
701#if QT_CONFIG(draganddrop)
702
703class QMimeData;
704
705class Q_GUI_EXPORT QDropEvent : public QEvent
706{
707 Q_DECL_EVENT_COMMON(QDropEvent)
708public:
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
737protected:
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
749class Q_GUI_EXPORT QDragMoveEvent : public QDropEvent
750{
751 Q_DECL_EVENT_COMMON(QDragMoveEvent)
752public:
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
764protected:
765 QRect m_rect;
766};
767
768
769class Q_GUI_EXPORT QDragEnterEvent : public QDragMoveEvent
770{
771 Q_DECL_EVENT_COMMON(QDragEnterEvent)
772public:
773 QDragEnterEvent(const QPoint &pos, Qt::DropActions actions, const QMimeData *data,
774 Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers);
775};
776
777
778class Q_GUI_EXPORT QDragLeaveEvent : public QEvent
779{
780 Q_DECL_EVENT_COMMON(QDragLeaveEvent)
781public:
782 QDragLeaveEvent();
783};
784#endif // QT_CONFIG(draganddrop)
785
786
787class Q_GUI_EXPORT QHelpEvent : public QEvent
788{
790public:
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
801private:
802 QPoint m_pos;
803 QPoint m_globalPos;
804};
805
806#ifndef QT_NO_STATUSTIP
807class Q_GUI_EXPORT QStatusTipEvent : public QEvent
808{
810public:
811 explicit QStatusTipEvent(const QString &tip);
812
813 inline QString tip() const { return m_tip; }
814private:
815 QString m_tip;
816};
817#endif
818
819#if QT_CONFIG(whatsthis)
820class Q_GUI_EXPORT QWhatsThisClickedEvent : public QEvent
821{
822 Q_DECL_EVENT_COMMON(QWhatsThisClickedEvent)
823public:
824 explicit QWhatsThisClickedEvent(const QString &href);
825
826 inline QString href() const { return m_href; }
827private:
828 QString m_href;
829};
830#endif
831
832#if QT_CONFIG(action)
833class Q_GUI_EXPORT QActionEvent : public QEvent
834{
836public:
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; }
841private:
842 QAction *m_action;
843 QAction *m_before;
844};
845#endif // QT_CONFIG(action)
846
847class Q_GUI_EXPORT QFileOpenEvent : public QEvent
848{
850public:
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
860private:
861 QString m_file;
862 QUrl m_url;
863};
864
865#ifndef QT_NO_TOOLBAR
866class Q_GUI_EXPORT QToolBarChangeEvent : public QEvent
867{
869public:
870 explicit QToolBarChangeEvent(bool t);
871
872 inline bool toggle() const { return m_toggle; }
873private:
874 bool m_toggle;
875};
876#endif
877
878#if QT_CONFIG(shortcut)
879class Q_GUI_EXPORT QShortcutEvent : public QEvent
880{
882public:
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; }
891protected:
892 QKeySequence m_sequence;
893 int m_shortcutId;
894 bool m_ambiguous;
895};
896#endif
897
898class Q_GUI_EXPORT QWindowStateChangeEvent: public QEvent
899{
901public:
902 explicit QWindowStateChangeEvent(Qt::WindowStates oldState, bool isOverride = false);
903
904 inline Qt::WindowStates oldState() const { return m_oldStates; }
905 bool isOverride() const;
906
907private:
908 Qt::WindowStates m_oldStates;
909 bool m_override;
910};
911
912#ifndef QT_NO_DEBUG_STREAM
913Q_GUI_EXPORT QDebug operator<<(QDebug, const QEvent *);
914#endif
915
916class Q_GUI_EXPORT QTouchEvent : public QPointerEvent
917{
919public:
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
945protected:
946 QObject *m_target = nullptr;
947 QEventPoint::States m_touchPointStates = QEventPoint::State::Unknown;
949};
950
951class Q_GUI_EXPORT QScrollPrepareEvent : public QEvent
952{
954public:
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
967private:
968 QRectF m_contentPosRange;
969 QSizeF m_viewportSize;
970 QPointF m_startPos;
971 QPointF m_contentPos;
972};
973
974
975class Q_GUI_EXPORT QScrollEvent : public QEvent
976{
978public:
980 {
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
992private:
993 QPointF m_contentPos;
994 QPointF m_overshoot;
996};
997
998class Q_GUI_EXPORT QScreenOrientationChangeEvent : public QEvent
999{
1001public:
1003
1004 QScreen *screen() const { return m_screen; }
1005 Qt::ScreenOrientation orientation() const { return m_orientation; }
1006
1007private:
1008 QScreen *m_screen;
1009 Qt::ScreenOrientation m_orientation;
1010};
1011
1012class Q_GUI_EXPORT QApplicationStateChangeEvent : public QEvent
1013{
1015public:
1017
1018 Qt::ApplicationState applicationState() const { return m_applicationState; }
1019
1020private:
1021 Qt::ApplicationState m_applicationState;
1022};
1023
1024class Q_GUI_EXPORT QChildWindowEvent : public QEvent
1025{
1027public:
1028 explicit QChildWindowEvent(Type type, QWindow *childWindow);
1029 QWindow *child() const { return c; }
1030
1031private:
1032 QWindow *c;
1033};
1034
1036
1037#endif // QEVENT_H
NSData * m_data
IOBluetoothDevice * device
The QActionEvent class provides an event that is generated when a QAction is added,...
The QAction class provides an abstraction for user commands that can be added to different user inter...
Definition qaction.h:30
Qt::ApplicationState applicationState() const
Returns the state of the application.
Definition qevent.h:1018
The QApplication class manages the GUI application's control flow and main settings.
\inmodule QtGui
Definition qevent.h:1025
QWindow * child() const
Returns the child window that was added or removed.
Definition qevent.h:1029
The QCloseEvent class contains parameters that describe a close event.
Definition qevent.h:562
The QContextMenuEvent class contains parameters that describe a context menu event.
Definition qevent.h:594
int y() const
Returns the y position of the mouse pointer, relative to the widget that received the event.
Definition qevent.h:607
const QPoint & pos() const
Returns the position of the mouse pointer relative to the widget that received the event.
Definition qevent.h:611
const QPoint & globalPos() const
Returns the global position of the mouse pointer at the time of the event.
Definition qevent.h:612
int x() const
Returns the x position of the mouse pointer, relative to the widget that received the event.
Definition qevent.h:606
int globalY() const
Returns the global y position of the mouse pointer at the time of the event.
Definition qevent.h:609
QPoint m_globalPos
Definition qevent.h:618
int globalX() const
Returns the global x position of the mouse pointer at the time of the event.
Definition qevent.h:608
Reason
This enum describes the reason why the event was sent.
Definition qevent.h:597
Reason reason() const
Returns the reason for this context event.
Definition qevent.h:614
\inmodule QtCore
\inmodule QtGui
Definition qevent.h:165
The QEventPoint class provides information about a point in a QPointerEvent.
Definition qeventpoint.h:20
\inmodule QtCore
Definition qcoreevent.h:45
Type
This enum type defines the valid event types in Qt.
Definition qcoreevent.h:51
The QExposeEvent class contains event parameters for expose events. \inmodule QtGui.
Definition qevent.h:515
QRegion m_region
Definition qevent.h:526
The QFileOpenEvent class provides an event that will be sent when there is a request to open a file o...
Definition qevent.h:848
QUrl url() const
Returns the url that the application should open.
Definition qevent.h:855
QString file() const
Returns the name of the file that the application should open.
Definition qevent.h:854
\inmodule QtCore
Definition qfile.h:93
The QFocusEvent class contains event parameters for widget focus events.
Definition qevent.h:470
bool lostFocus() const
Returns true if type() is QEvent::FocusOut; otherwise returns false.
Definition qevent.h:476
bool gotFocus() const
Returns true if type() is QEvent::FocusIn; otherwise returns false.
Definition qevent.h:475
The QGesture class represents a gesture, containing properties that describe the corresponding user i...
Definition qgesture.h:29
The QHelpEvent class provides an event that is used to request helpful information about a particular...
Definition qevent.h:788
int x() const
Same as pos().x().
Definition qevent.h:793
const QPoint & globalPos() const
Returns the mouse cursor position when the event was generated in global coordinates.
Definition qevent.h:799
const QPoint & pos() const
Returns the mouse cursor position when the event was generated, relative to the widget to which the e...
Definition qevent.h:798
int y() const
Same as pos().y().
Definition qevent.h:794
int globalY() const
Same as globalPos().y().
Definition qevent.h:796
int globalX() const
Same as globalPos().x().
Definition qevent.h:795
The QHideEvent class provides an event which is sent after a widget is hidden.
Definition qevent.h:586
\inmodule QtGui
Definition qevent.h:246
QPoint oldPos() const
Returns the previous position of the mouse cursor, relative to the widget that received the event.
Definition qevent.h:272
QPointF oldPosF() const
Returns the previous position of the mouse cursor, relative to the widget that received the event.
Definition qevent.h:273
bool isUpdateEvent() const override
Definition qevent.h:269
QPointF m_oldPos
Definition qevent.h:276
\inmodule QtCore \reentrant
Definition qiodevice.h:34
The QIconDragEvent class indicates that a main icon drag has begun.
Definition qevent.h:570
The QInputDevice class describes a device from which a QInputEvent originates.
DeviceType
This enum represents the type of device that generated a QPointerEvent.
DeviceType type
static const QInputDevice * primaryKeyboard(const QString &seatName=QString())
Returns the core or master keyboard on the given seat seatName.
\inmodule QtGui
Definition qevent.h:49
QInputDevice::DeviceType deviceType() const
Returns the type of device that generated the event.
Definition qevent.h:55
virtual void setTimestamp(quint64 timestamp)
Definition qevent.h:59
const QInputDevice * device() const
Definition qevent.h:54
quint64 timestamp() const
Returns the window system's timestamp for this event.
Definition qevent.h:58
QInputEvent(Type type, PointerEventTag, const QInputDevice *dev, Qt::KeyboardModifiers modifiers=Qt::NoModifier)
QInputEvent(Type type, SinglePointEventTag, const QInputDevice *dev, Qt::KeyboardModifiers modifiers=Qt::NoModifier)
void setModifiers(Qt::KeyboardModifiers modifiers)
Definition qevent.h:57
Qt::KeyboardModifiers modifiers() const
Returns the keyboard modifier flags that existed immediately before the event occurred.
Definition qevent.h:56
Attribute(AttributeType typ, int s, int l, QVariant val)
Constructs an input method attribute.
Definition qevent.h:637
Attribute(AttributeType typ, int s, int l)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qevent.h:638
The QInputMethodEvent class provides parameters for input method events.
Definition qevent.h:625
const QString & preeditString() const
Returns the preedit text, i.e.
Definition qevent.h:650
int replacementLength() const
Returns the number of characters to be replaced in the preedit string.
Definition qevent.h:654
const QString & commitString() const
Returns the text that should get added to (or replace parts of) the text of the editor widget.
Definition qevent.h:652
int replacementStart() const
Returns the position at which characters are to be replaced relative from the start of the preedit st...
Definition qevent.h:653
friend bool operator!=(const QInputMethodEvent::Attribute &lhs, const QInputMethodEvent::Attribute &rhs)
Definition qevent.h:663
friend bool operator==(const QInputMethodEvent::Attribute &lhs, const QInputMethodEvent::Attribute &rhs)
Definition qevent.h:656
const QList< Attribute > & attributes() const
Returns the list of attributes passed to the QInputMethodEvent constructor.
Definition qevent.h:649
AttributeType
\value TextFormat A QTextCharFormat for the part of the preedit string specified by start and length.
Definition qevent.h:628
The QInputMethodQueryEvent class provides an event sent by the input context to input objects.
Definition qevent.h:679
Qt::InputMethodQueries queries() const
Returns the properties queried by the event.
Definition qevent.h:684
The QKeyEvent class describes a key event.
Definition qevent.h:424
quint16 m_autoRepeat
Definition qevent.h:465
int count() const
Returns the number of keys involved in this event.
Definition qevent.h:445
quint32 m_virtualKey
Definition qevent.h:462
quint32 nativeScanCode() const
Definition qevent.h:447
QString text() const
Returns the Unicode text that this key generated.
Definition qevent.h:443
quint16 m_count
Definition qevent.h:464
quint32 nativeVirtualKey() const
Definition qevent.h:448
bool isAutoRepeat() const
Returns true if this event comes from an auto-repeating key; returns false if it comes from an initia...
Definition qevent.h:444
QString m_text
Definition qevent.h:459
quint32 m_nativeModifiers
Definition qevent.h:463
quint32 nativeModifiers() const
Definition qevent.h:449
int key() const
Returns the code of the key that was pressed or released.
Definition qevent.h:434
quint32 m_scanCode
Definition qevent.h:461
QKeyCombination keyCombination() const
Returns a QKeyCombination object containing both the key() and the modifiers() carried by this event.
Definition qevent.h:439
int m_key
Definition qevent.h:460
The QKeySequence class encapsulates a key sequence as used by shortcuts.
Definition qlist.h:75
\inmodule QtCore
Definition qmimedata.h:16
\inmodule QtGui
Definition qevent.h:196
QMouseEvent(Type type, const QPointF &localPos, const QPointF &scenePos, const QPointF &globalPos, Qt::MouseButton button, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Qt::MouseEventSource source, const QPointingDevice *device=QPointingDevice::primaryPointingDevice())
QMouseEvent(Type type, const QPointF &localPos, const QPointF &scenePos, const QPointF &globalPos, Qt::MouseButton button, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, const QPointingDevice *device=QPointingDevice::primaryPointingDevice())
QPoint pos() const
Definition qevent.h:219
The QMoveEvent class contains event parameters for move events.
Definition qevent.h:502
const QPoint & oldPos() const
Returns the old position of the widget.
Definition qevent.h:508
QPoint m_oldPos
Definition qevent.h:510
const QPoint & pos() const
Returns the new position of the widget.
Definition qevent.h:507
The QNativeGestureEvent class contains parameters that describe a gesture event. \inmodule QtGui.
\inmodule QtCore
Definition qobject.h:103
The QPaintEvent class contains event parameters for paint events.
Definition qevent.h:486
bool m_erased
Definition qevent.h:498
const QRegion & region() const
Returns the region that needs to be updated.
Definition qevent.h:493
QRect m_rect
Definition qevent.h:496
const QRect & rect() const
Returns the rectangle that needs to be updated.
Definition qevent.h:492
QRegion m_region
Definition qevent.h:497
The QPlatformSurfaceEvent class is used to notify about native platform surface events....
Definition qevent.h:531
SurfaceEventType
This enum describes the type of platform surface event.
Definition qevent.h:534
SurfaceEventType m_surfaceEventType
Definition qevent.h:544
SurfaceEventType surfaceEventType() const
Returns the specific type of platform surface event.
Definition qevent.h:541
\inmodule QtCore\reentrant
Definition qpoint.h:217
constexpr QPoint toPoint() const
Rounds the coordinates of this point to the nearest integer, and returns a QPoint object with the rou...
Definition qpoint.h:404
\inmodule QtCore\reentrant
Definition qpoint.h:25
A base class for pointer events.
Definition qevent.h:73
virtual bool isEndEvent() const
Definition qevent.h:92
qsizetype pointCount() const
Returns the number of points in this pointer event.
Definition qevent.h:85
QList< QEventPoint > m_points
Definition qevent.h:105
void setExclusiveGrabber(const QEventPoint &point, QObject *exclusiveGrabber)
Informs the delivery logic that the given exclusiveGrabber is to receive all future update events and...
Definition qevent.cpp:369
virtual bool isBeginEvent() const
Definition qevent.h:90
QObject * exclusiveGrabber(const QEventPoint &point) const
Returns the object which has been set to receive all future update events and the release event conta...
Definition qevent.cpp:351
QPointerEvent(Type type, const QPointingDevice *dev, Qt::KeyboardModifiers modifiers=Qt::NoModifier, const QList< QEventPoint > &points={})
QPointingDevice::PointerType pointerType() const
Returns the type of point that generated the event.
Definition qevent.h:81
const QList< QEventPoint > & points() const
Returns a list of points in this pointer event.
Definition qevent.h:87
QPointerEvent(Type type, SinglePointEventTag, const QInputDevice *dev, Qt::KeyboardModifiers modifiers=Qt::NoModifier)
virtual bool isUpdateEvent() const
Definition qevent.h:91
The QPointingDevice class describes a device from which mouse, touch or tablet events originate.
static const QPointingDevice * primaryPointingDevice(const QString &seatName=QString())
Returns the primary pointing device (the core pointer, traditionally assumed to be a mouse) on the gi...
PointerType
This enum represents what is interacting with the pointing device.
\inmodule QtCore\reentrant
Definition qrect.h:484
\inmodule QtCore\reentrant
Definition qrect.h:30
The QRegion class specifies a clip region for a painter.
Definition qregion.h:27
The QResizeEvent class contains event parameters for resize events.
Definition qevent.h:548
QSize m_oldSize
Definition qevent.h:556
const QSize & oldSize() const
Returns the old size of the widget.
Definition qevent.h:554
const QSize & size() const
Returns the new size of the widget.
Definition qevent.h:553
QScreen * screen() const
Returns the screen whose orientation changed.
Definition qevent.h:1004
Qt::ScreenOrientation orientation() const
Returns the orientation of the screen.
Definition qevent.h:1005
The QScreen class is used to query screen properties. \inmodule QtGui.
Definition qscreen.h:32
The QScrollEvent class is sent when scrolling.
Definition qevent.h:976
ScrollState scrollState() const
Returns the current scroll state as a combination of ScrollStateFlag values.
Definition qevent.h:990
QPointF contentPos() const
Returns the new scroll position.
Definition qevent.h:988
QPointF overshootDistance() const
Returns the new overshoot distance.
Definition qevent.h:989
ScrollState
This enum describes the states a scroll event can have.
Definition qevent.h:980
@ ScrollStarted
Definition qevent.h:981
@ ScrollUpdated
Definition qevent.h:982
The QScrollPrepareEvent class is sent in preparation of scrolling.
Definition qevent.h:952
QPointF contentPos() const
Returns the current position of the content as set by setContentPos.
Definition qevent.h:961
QPointF startPos() const
Returns the position of the touch or mouse event that started the scrolling.
Definition qevent.h:957
QRectF contentPosRange() const
Returns the range of coordinates for the content as set by setContentPosRange().
Definition qevent.h:960
QSizeF viewportSize() const
Returns size of the area that is to be scrolled as set by setViewportSize.
Definition qevent.h:959
The QShortcutEvent class provides an event which is generated when the user presses a key combination...
The QShortcut class is used to create keyboard shortcuts.
Definition qshortcut.h:19
The QShowEvent class provides an event that is sent when a widget is shown.
Definition qevent.h:578
A base class for pointer events containing a single point, such as mouse events.
Definition qevent.h:109
quint16 m_reserved2
Definition qevent.h:156
QPointF globalPosition() const
Returns the position of the point in this event on the screen or virtual desktop.
Definition qevent.h:123
Qt::MouseEventSource m_source
Definition qevent.h:148
QPointF position() const
Returns the position of the point in this event, relative to the widget or item that received the eve...
Definition qevent.h:119
quint16 m_invertedScrolling
Definition qevent.h:161
void setExclusivePointGrabber(QObject *exclusiveGrabber)
Definition qevent.h:132
QSinglePointEvent(Type type, const QPointingDevice *dev, const QEventPoint &point, Qt::MouseButton button, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Qt::MouseEventSource source)
QSinglePointEvent(Type type, const QPointingDevice *dev, const QPointF &localPos, const QPointF &scenePos, const QPointF &globalPos, Qt::MouseButton button, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Qt::MouseEventSource source=Qt::MouseEventNotSynthesized)
quint16 m_doubleClick
Definition qevent.h:158
quint16 m_reserved
Definition qevent.h:155
QPointF scenePosition() const
Returns the position of the point in this event, relative to the window or scene.
Definition qevent.h:121
Qt::MouseButton button() const
Returns the button that caused the event.
Definition qevent.h:116
Qt::MouseButtons buttons() const
Returns the button state when the event was generated.
Definition qevent.h:117
QObject * exclusivePointGrabber() const
Definition qevent.h:130
quint16 m_phase
Definition qevent.h:160
\inmodule QtCore
Definition qsize.h:208
\inmodule QtCore
Definition qsize.h:25
The QStatusTipEvent class provides an event that is used to show messages in a status bar.
Definition qevent.h:808
QString tip() const
Returns the message to show in the status bar.
Definition qevent.h:813
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
The QToolBarChangeEvent class provides an event that is sent whenever a the toolbar button is clicked...
Definition qevent.h:867
bool toggle() const
Definition qevent.h:872
The QTouchEvent class contains parameters that describe a touch event.
Definition qevent.h:917
QObject * target() const
Returns the target object within the window on which the event occurred.
Definition qevent.h:935
QEventPoint::States touchPointStates() const
Returns a bitwise OR of all the touch point states for this event.
Definition qevent.h:936
quint32 m_reserved
Definition qevent.h:948
\inmodule QtCore
Definition qurl.h:94
\inmodule QtCore
Definition qvariant.h:65
The QVector2D class represents a vector or vertex in 2D space.
Definition qvectornd.h:31
\inmodule QtGui
Definition qevent.h:899
Qt::WindowStates oldState() const
Returns the state of the window before the change.
Definition qevent.h:904
\inmodule QtGui
Definition qwindow.h:63
EGLImageKHR int int EGLuint64KHR * modifiers
QString text
QPushButton * button
[2]
rect
[4]
else opt state
[0]
Combined button and popup list for selecting options.
Definition qcompare.h:63
InputMethodQuery
MouseButton
Definition qnamespace.h:56
@ NoButton
Definition qnamespace.h:57
MouseEventSource
@ MouseEventNotSynthesized
ScreenOrientation
Definition qnamespace.h:271
@ NoModifier
DropAction
ApplicationState
Definition qnamespace.h:262
NativeGestureType
ScrollPhase
FocusReason
@ OtherFocusReason
#define Q_DECL_EVENT_COMMON(Class)
Definition qcoreevent.h:20
static FILE * openFile(const QString &filename, const QString &mode)
Definition qctflib.cpp:48
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
Q_GUI_EXPORT QDebug operator<<(QDebug, const QEvent *)
Definition qevent.cpp:4043
int qRound(qfloat16 d) noexcept
Definition qfloat16.h:327
static bool matches(const QJsonObject &object, const QString &osName, const QVersionNumber &kernelVersion, const QString &osRelease, const QOpenGLConfig::Gpu &gpu)
Definition qopengl.cpp:270
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat z
GLint GLint GLint GLint GLint x
[0]
GLuint64 key
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLboolean r
[2]
GLenum GLuint GLenum GLsizei length
GLenum GLenum GLsizei count
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum type
GLbitfield flags
GLuint start
GLint first
GLint y
GLsizei GLsizei GLchar * source
GLfixed GLfixed GLint GLint GLfixed points
GLdouble s
[6]
Definition qopenglext.h:235
GLenum query
const GLubyte * c
GLuint GLfloat * val
GLdouble GLdouble t
Definition qopenglext.h:243
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
bool operator==(const QRandomGenerator &rng1, const QRandomGenerator &rng2)
Definition qrandom.cpp:1220
#define Q_ASSERT(cond)
Definition qrandom.cpp:47
QScreen * screen
[1]
Definition main.cpp:29
#define QT_DEPRECATED_VERSION_X_6_3(text)
#define QT_DEPRECATED_VERSION_X_6_4(text)
#define QT_DEPRECATED_VERSION_X_6_6(text)
#define QT_DEPRECATED_VERSION_X_6_0(text)
#define QT_DEPRECATED_VERSION_X_6_2(text)
#define Q_PROPERTY(...)
#define Q_GADGET
@ Q_RELOCATABLE_TYPE
Definition qtypeinfo.h:158
#define Q_DECLARE_TYPEINFO(TYPE, FLAGS)
Definition qtypeinfo.h:180
unsigned int quint32
Definition qtypes.h:50
unsigned short quint16
Definition qtypes.h:48
unsigned long long quint64
Definition qtypes.h:61
ptrdiff_t qsizetype
Definition qtypes.h:165
unsigned int uint
Definition qtypes.h:34
long long qint64
Definition qtypes.h:60
double qreal
Definition qtypes.h:187
#define explicit
QFile file
[0]
settings setValue("DataPump/bgcolor", color)
QUrl url("example.com")
[constructor-url-reference]
QMimeData * mimeData
setDropAction(proposedAction())
[0]
Definition moc.h:23