Qt 6.x
The Qt SDK
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/qpointer.h>
18#include <QtCore/qstring.h>
19#include <QtCore/qurl.h>
20#include <QtCore/qvariant.h>
21#include <QtGui/qeventpoint.h>
22#include <QtGui/qpointingdevice.h>
23#include <QtGui/qregion.h>
24#include <QtGui/qwindowdefs.h>
25
26#if QT_CONFIG(shortcut)
27# include <QtGui/qkeysequence.h>
28#endif
29
30class tst_QEvent;
31
33
34class QFile;
35class QAction;
36class QMouseEvent;
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{
75public:
76 explicit QPointerEvent(Type type, const QPointingDevice *dev,
77 Qt::KeyboardModifiers modifiers = Qt::NoModifier, const QList<QEventPoint> &points = {});
78
79 const QPointingDevice *pointingDevice() const;
81 return pointingDevice() ? pointingDevice()->pointerType() : QPointingDevice::PointerType::Unknown;
82 }
83 void setTimestamp(quint64 timestamp) override;
84 qsizetype pointCount() const { return m_points.size(); }
85 QEventPoint &point(qsizetype i);
86 const QList<QEventPoint> &points() const { return m_points; }
87 QEventPoint *pointById(int id);
88 bool allPointsGrabbed() const;
89 virtual bool isBeginEvent() const { return false; }
90 virtual bool isUpdateEvent() const { return false; }
91 virtual bool isEndEvent() const { return false; }
92 bool allPointsAccepted() const;
93 virtual void setAccepted(bool accepted) override;
94 QObject *exclusiveGrabber(const QEventPoint &point) const;
95 void setExclusiveGrabber(const QEventPoint &point, QObject *exclusiveGrabber);
96 QList<QPointer <QObject>> passiveGrabbers(const QEventPoint &point) const;
97 void clearPassiveGrabbers(const QEventPoint &point);
98 bool addPassiveGrabber(const QEventPoint &point, QObject *grabber);
99 bool removePassiveGrabber(const QEventPoint &point, QObject *grabber);
100
101protected:
103
105};
106
107class Q_GUI_EXPORT QSinglePointEvent : public QPointerEvent
108{
110 Q_PROPERTY(QObject *exclusivePointGrabber READ exclusivePointGrabber
111 WRITE setExclusivePointGrabber)
112
114public:
115 inline Qt::MouseButton button() const { return m_button; }
116 inline Qt::MouseButtons buttons() const { return m_mouseState; }
117
118 inline QPointF position() const
119 { Q_ASSERT(!m_points.isEmpty()); return m_points.first().position(); }
120 inline QPointF scenePosition() const
121 { Q_ASSERT(!m_points.isEmpty()); return m_points.first().scenePosition(); }
122 inline QPointF globalPosition() const
123 { Q_ASSERT(!m_points.isEmpty()); return m_points.first().globalPosition(); }
124
125 bool isBeginEvent() const override;
126 bool isUpdateEvent() const override;
127 bool isEndEvent() const override;
128
131 void setExclusivePointGrabber(QObject *exclusiveGrabber)
132 { QPointerEvent::setExclusiveGrabber(points().first(), exclusiveGrabber); }
133
134protected:
135 friend class ::tst_QEvent;
137 Qt::MouseButton button, Qt::MouseButtons buttons,
138 Qt::KeyboardModifiers modifiers, Qt::MouseEventSource source);
139 QSinglePointEvent(Type type, const QPointingDevice *dev, const QPointF &localPos,
140 const QPointF &scenePos, const QPointF &globalPos,
141 Qt::MouseButton button, Qt::MouseButtons buttons,
142 Qt::KeyboardModifiers modifiers,
144
146 Qt::MouseButtons m_mouseState = Qt::NoButton;
148 /*
149 Fill up to the next 8-byte aligned size: 88
150 We have 32bits left, use some for QSinglePointEvent subclasses so that
151 we don't end up with gaps.
152 */
153 // split this in two quint16; with a quint32, MSVC would 32-bit align it
156 // for QMouseEvent
158 // for QWheelEvent
161};
162
163class Q_GUI_EXPORT QEnterEvent : public QSinglePointEvent
164{
166public:
167 QEnterEvent(const QPointF &localPos, const QPointF &scenePos, const QPointF &globalPos,
169
170#if QT_DEPRECATED_SINCE(6, 0)
171#ifndef QT_NO_INTEGER_EVENT_COORDINATES
172 QT_DEPRECATED_VERSION_X_6_0("Use position()")
173 inline QPoint pos() const { return position().toPoint(); }
174 QT_DEPRECATED_VERSION_X_6_0("Use globalPosition()")
175 inline QPoint globalPos() const { return globalPosition().toPoint(); }
176 QT_DEPRECATED_VERSION_X_6_0("Use position()")
177 inline int x() const { return qRound(position().x()); }
178 QT_DEPRECATED_VERSION_X_6_0("Use position()")
179 inline int y() const { return qRound(position().y()); }
180 QT_DEPRECATED_VERSION_X_6_0("Use globalPosition()")
181 inline int globalX() const { return qRound(globalPosition().x()); }
182 QT_DEPRECATED_VERSION_X_6_0("Use globalPosition()")
183 inline int globalY() const { return qRound(globalPosition().y()); }
184#endif
185 QT_DEPRECATED_VERSION_X_6_0("Use position()")
186 QPointF localPos() const { return position(); }
187 QT_DEPRECATED_VERSION_X_6_0("Use scenePosition()")
188 QPointF windowPos() const { return scenePosition(); }
189 QT_DEPRECATED_VERSION_X_6_0("Use globalPosition()")
190 QPointF screenPos() const { return globalPosition(); }
191#endif // QT_DEPRECATED_SINCE(6, 0)
192};
193
194class Q_GUI_EXPORT QMouseEvent : public QSinglePointEvent
195{
197public:
198#if QT_DEPRECATED_SINCE(6, 4)
199 QT_DEPRECATED_VERSION_X_6_4("Use another constructor")
201 Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers,
203#endif
204 QMouseEvent(Type type, const QPointF &localPos, const QPointF &globalPos,
205 Qt::MouseButton button, Qt::MouseButtons buttons,
206 Qt::KeyboardModifiers modifiers,
208 QMouseEvent(Type type, const QPointF &localPos, const QPointF &scenePos, const QPointF &globalPos,
209 Qt::MouseButton button, Qt::MouseButtons buttons,
210 Qt::KeyboardModifiers modifiers,
212 QMouseEvent(Type type, const QPointF &localPos, const QPointF &scenePos, const QPointF &globalPos,
213 Qt::MouseButton button, Qt::MouseButtons buttons,
214 Qt::KeyboardModifiers modifiers, Qt::MouseEventSource source,
216
217#ifndef QT_NO_INTEGER_EVENT_COORDINATES
218 inline QPoint pos() const { return position().toPoint(); }
219#endif
220#if QT_DEPRECATED_SINCE(6, 0)
221#ifndef QT_NO_INTEGER_EVENT_COORDINATES
222 QT_DEPRECATED_VERSION_X_6_0("Use globalPosition()")
223 inline QPoint globalPos() const { return globalPosition().toPoint(); }
224 QT_DEPRECATED_VERSION_X_6_0("Use position()")
225 inline int x() const { return qRound(position().x()); }
226 QT_DEPRECATED_VERSION_X_6_0("Use position()")
227 inline int y() const { return qRound(position().y()); }
228 QT_DEPRECATED_VERSION_X_6_0("Use globalPosition()")
229 inline int globalX() const { return qRound(globalPosition().x()); }
230 QT_DEPRECATED_VERSION_X_6_0("Use globalPosition()")
231 inline int globalY() const { return qRound(globalPosition().y()); }
232#endif // QT_NO_INTEGER_EVENT_COORDINATES
233 QT_DEPRECATED_VERSION_X_6_0("Use position()")
234 QPointF localPos() const { return position(); }
235 QT_DEPRECATED_VERSION_X_6_0("Use scenePosition()")
236 QPointF windowPos() const { return scenePosition(); }
237 QT_DEPRECATED_VERSION_X_6_0("Use globalPosition()")
238 QPointF screenPos() const { return globalPosition(); }
239#endif // QT_DEPRECATED_SINCE(6, 0)
241 Qt::MouseEventFlags flags() const;
242};
243
244class Q_GUI_EXPORT QHoverEvent : public QSinglePointEvent
245{
247public:
248 QHoverEvent(Type type, const QPointF &scenePos, const QPointF &globalPos, const QPointF &oldPos,
249 Qt::KeyboardModifiers modifiers = Qt::NoModifier,
251#if QT_DEPRECATED_SINCE(6, 3)
252 QT_DEPRECATED_VERSION_X_6_3("Use the other constructor")
253 QHoverEvent(Type type, const QPointF &pos, const QPointF &oldPos,
254 Qt::KeyboardModifiers modifiers = Qt::NoModifier,
256#endif
257
258#if QT_DEPRECATED_SINCE(6, 0)
259#ifndef QT_NO_INTEGER_EVENT_COORDINATES
260 QT_DEPRECATED_VERSION_X_6_0("Use position()")
261 inline QPoint pos() const { return position().toPoint(); }
262#endif
263
264 QT_DEPRECATED_VERSION_X_6_0("Use position()")
265 inline QPointF posF() const { return position(); }
266#endif // QT_DEPRECATED_SINCE(6, 0)
267
268 bool isUpdateEvent() const override { return true; }
269
270 // TODO deprecate when we figure out an actual replacement (point history?)
271 inline QPoint oldPos() const { return m_oldPos.toPoint(); }
272 inline QPointF oldPosF() const { return m_oldPos; }
273
274protected:
275 QPointF m_oldPos; // TODO remove?
276};
277
278#if QT_CONFIG(wheelevent)
279class Q_GUI_EXPORT QWheelEvent : public QSinglePointEvent
280{
282 Q_PROPERTY(const QPointingDevice *device READ pointingDevice)
283 Q_PROPERTY(QPoint pixelDelta READ pixelDelta)
284 Q_PROPERTY(QPoint angleDelta READ angleDelta)
285 Q_PROPERTY(Qt::ScrollPhase phase READ phase)
286 Q_PROPERTY(bool inverted READ inverted)
287
288 Q_DECL_EVENT_COMMON(QWheelEvent)
289public:
290 enum { DefaultDeltasPerStep = 120 };
291
292 QWheelEvent(const QPointF &pos, const QPointF &globalPos, QPoint pixelDelta, QPoint angleDelta,
293 Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Qt::ScrollPhase phase,
296
297 inline QPoint pixelDelta() const { return m_pixelDelta; }
298 inline QPoint angleDelta() const { return m_angleDelta; }
299
300 inline Qt::ScrollPhase phase() const { return Qt::ScrollPhase(m_phase); }
301 inline bool inverted() const { return m_invertedScrolling; }
302 inline bool isInverted() const { return m_invertedScrolling; }
303 inline bool hasPixelDelta() const { return !m_pixelDelta.isNull(); }
304
305 bool isBeginEvent() const override;
306 bool isUpdateEvent() const override;
307 bool isEndEvent() const override;
308 Qt::MouseEventSource source() const { return Qt::MouseEventSource(m_source); }
309
310protected:
311 QPoint m_pixelDelta;
312 QPoint m_angleDelta;
313};
314#endif
315
316#if QT_CONFIG(tabletevent)
317class Q_GUI_EXPORT QTabletEvent : public QSinglePointEvent
318{
319 Q_DECL_EVENT_COMMON(QTabletEvent)
320public:
321 QTabletEvent(Type t, const QPointingDevice *device,
322 const QPointF &pos, const QPointF &globalPos,
323 qreal pressure, float xTilt, float yTilt,
324 float tangentialPressure, qreal rotation, float z,
325 Qt::KeyboardModifiers keyState,
326 Qt::MouseButton button, Qt::MouseButtons buttons);
327
328#if QT_DEPRECATED_SINCE(6, 0)
329 QT_DEPRECATED_VERSION_X_6_0("Use position()")
330 inline QPoint pos() const { return position().toPoint(); }
331 QT_DEPRECATED_VERSION_X_6_0("Use globalPosition()")
332 inline QPoint globalPos() const { return globalPosition().toPoint(); }
333
334 QT_DEPRECATED_VERSION_X_6_0("Use position()")
335 inline const QPointF posF() const { return position(); }
336 QT_DEPRECATED_VERSION_X_6_0("Use globalPosition()")
337 inline const QPointF globalPosF() const { return globalPosition(); }
338 QT_DEPRECATED_VERSION_X_6_0("Use position().x()")
339 inline int x() const { return qRound(position().x()); }
340 QT_DEPRECATED_VERSION_X_6_0("Use position().y()")
341 inline int y() const { return qRound(position().y()); }
342 QT_DEPRECATED_VERSION_X_6_0("Use globalPosition().x()")
343 inline int globalX() const { return qRound(globalPosition().x()); }
344 QT_DEPRECATED_VERSION_X_6_0("Use globalPosition().y()")
345 inline int globalY() const { return qRound(globalPosition().y()); }
346 QT_DEPRECATED_VERSION_X_6_0("use globalPosition().x()")
347 inline qreal hiResGlobalX() const { return globalPosition().x(); }
348 QT_DEPRECATED_VERSION_X_6_0("use globalPosition().y()")
349 inline qreal hiResGlobalY() const { return globalPosition().y(); }
350 QT_DEPRECATED_VERSION_X_6_0("use pointingDevice().uniqueId()")
351 inline qint64 uniqueId() const { return pointingDevice() ? pointingDevice()->uniqueId().numericId() : -1; }
352#endif
353 inline qreal pressure() const { Q_ASSERT(!points().isEmpty()); return points().first().pressure(); }
354 inline qreal rotation() const { Q_ASSERT(!points().isEmpty()); return points().first().rotation(); }
355 inline qreal z() const { return m_z; }
356 inline qreal tangentialPressure() const { return m_tangential; }
357 inline qreal xTilt() const { return m_xTilt; }
358 inline qreal yTilt() const { return m_yTilt; }
359
360protected:
361 float m_tangential;
362 float m_xTilt;
363 float m_yTilt;
364 float m_z;
365};
366#endif // QT_CONFIG(tabletevent)
367
368#if QT_CONFIG(gestures)
369class Q_GUI_EXPORT QNativeGestureEvent : public QSinglePointEvent
370{
372public:
373#if QT_DEPRECATED_SINCE(6, 2)
374 QT_DEPRECATED_VERSION_X_6_2("Use the other constructor")
375 QNativeGestureEvent(Qt::NativeGestureType type, const QPointingDevice *dev, const QPointF &localPos, const QPointF &scenePos,
376 const QPointF &globalPos, qreal value, quint64 sequenceId, quint64 intArgument);
377#endif
379 const QPointF &localPos, const QPointF &scenePos, const QPointF &globalPos,
380 qreal value, const QPointF &delta, quint64 sequenceId = UINT64_MAX);
381
382 Qt::NativeGestureType gestureType() const { return m_gestureType; }
383 int fingerCount() const { return m_fingerCount; }
384 qreal value() const { return m_realValue; }
385 QPointF delta() const {
386#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
387 return m_delta.toPointF();
388#else
389 return m_delta;
390#endif
391 }
392
393#if QT_DEPRECATED_SINCE(6, 0)
394#ifndef QT_NO_INTEGER_EVENT_COORDINATES
395 QT_DEPRECATED_VERSION_X_6_0("Use position().toPoint()")
396 inline const QPoint pos() const { return position().toPoint(); }
397 QT_DEPRECATED_VERSION_X_6_0("Use globalPosition().toPoint()")
398 inline const QPoint globalPos() const { return globalPosition().toPoint(); }
399#endif
400 QT_DEPRECATED_VERSION_X_6_0("Use position()")
401 QPointF localPos() const { return position(); }
402 QT_DEPRECATED_VERSION_X_6_0("Use scenePosition()")
403 QPointF windowPos() const { return scenePosition(); }
404 QT_DEPRECATED_VERSION_X_6_0("Use globalPosition()")
405 QPointF screenPos() const { return globalPosition(); }
406#endif
407
408protected:
409 quint64 m_sequenceId;
410#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
411 QVector2D m_delta;
412#else
413 QPointF m_delta;
414#endif
415 qreal m_realValue;
416 Qt::NativeGestureType m_gestureType;
417 quint32 m_fingerCount : 4;
418 quint32 m_reserved : 28;
419};
420#endif // QT_CONFIG(gestures)
421
422class Q_GUI_EXPORT QKeyEvent : public QInputEvent
423{
425public:
426 QKeyEvent(Type type, int key, Qt::KeyboardModifiers modifiers, const QString& text = QString(),
427 bool autorep = false, quint16 count = 1);
428 QKeyEvent(Type type, int key, Qt::KeyboardModifiers modifiers,
429 quint32 nativeScanCode, quint32 nativeVirtualKey, quint32 nativeModifiers,
430 const QString &text = QString(), bool autorep = false, quint16 count = 1,
432
433 int key() const { return m_key; }
434#if QT_CONFIG(shortcut)
436#endif
437 Qt::KeyboardModifiers modifiers() const;
439 {
440 return QKeyCombination(modifiers(), Qt::Key(m_key));
441 }
442 inline QString text() const { return m_text; }
443 inline bool isAutoRepeat() const { return m_autoRepeat; }
444 inline int count() const { return int(m_count); }
445
446 inline quint32 nativeScanCode() const { return m_scanCode; }
447 inline quint32 nativeVirtualKey() const { return m_virtualKey; }
448 inline quint32 nativeModifiers() const { return m_nativeModifiers; }
449
450#if QT_CONFIG(shortcut)
452 { return (e ? e->matches(key) : false); }
454 { return (e ? e->matches(key) : false); }
455#endif // QT_CONFIG(shortcut)
456
457protected:
459 int m_key;
465};
466
467
468class Q_GUI_EXPORT QFocusEvent : public QEvent
469{
471public:
473
474 inline bool gotFocus() const { return type() == FocusIn; }
475 inline bool lostFocus() const { return type() == FocusOut; }
476
477 Qt::FocusReason reason() const;
478
479private:
480 Qt::FocusReason m_reason;
481};
482
483
484class Q_GUI_EXPORT QPaintEvent : public QEvent
485{
487public:
488 explicit QPaintEvent(const QRegion& paintRegion);
489 explicit QPaintEvent(const QRect &paintRect);
490
491 inline const QRect &rect() const { return m_rect; }
492 inline const QRegion &region() const { return m_region; }
493
494protected:
498};
499
500class Q_GUI_EXPORT QMoveEvent : public QEvent
501{
503public:
504 QMoveEvent(const QPoint &pos, const QPoint &oldPos);
505
506 inline const QPoint &pos() const { return m_pos; }
507 inline const QPoint &oldPos() const { return m_oldPos;}
508protected:
510 friend class QApplication;
511};
512
513class Q_GUI_EXPORT QExposeEvent : public QEvent
514{
516public:
517 explicit QExposeEvent(const QRegion &m_region);
518
519#if QT_DEPRECATED_SINCE(6, 0)
520 QT_DEPRECATED_VERSION_X_6_0("Handle QPaintEvent instead")
521 inline const QRegion &region() const { return m_region; }
522#endif
523
524protected:
526 friend class QWidgetWindow;
527};
528
529class Q_GUI_EXPORT QPlatformSurfaceEvent : public QEvent
530{
532public:
535 SurfaceAboutToBeDestroyed
536 };
537
538 explicit QPlatformSurfaceEvent(SurfaceEventType surfaceEventType);
539
540 inline SurfaceEventType surfaceEventType() const { return m_surfaceEventType; }
541
542protected:
544};
545
546class Q_GUI_EXPORT QResizeEvent : public QEvent
547{
549public:
550 QResizeEvent(const QSize &size, const QSize &oldSize);
551
552 inline const QSize &size() const { return m_size; }
553 inline const QSize &oldSize()const { return m_oldSize;}
554protected:
556 friend class QApplication;
557};
558
559
560class Q_GUI_EXPORT QCloseEvent : public QEvent
561{
563public:
564 QCloseEvent();
565};
566
567
568class Q_GUI_EXPORT QIconDragEvent : public QEvent
569{
571public:
573};
574
575
576class Q_GUI_EXPORT QShowEvent : public QEvent
577{
579public:
580 QShowEvent();
581};
582
583
584class Q_GUI_EXPORT QHideEvent : public QEvent
585{
587public:
588 QHideEvent();
589};
590
591#ifndef QT_NO_CONTEXTMENU
592class Q_GUI_EXPORT QContextMenuEvent : public QInputEvent
593{
595public:
597
598 QContextMenuEvent(Reason reason, const QPoint &pos, const QPoint &globalPos,
599 Qt::KeyboardModifiers modifiers = Qt::NoModifier);
600#if QT_DEPRECATED_SINCE(6, 4)
601 QT_DEPRECATED_VERSION_X_6_4("Use the other constructor")
602 QContextMenuEvent(Reason reason, const QPoint &pos);
603#endif
604
605 inline int x() const { return m_pos.x(); }
606 inline int y() const { return m_pos.y(); }
607 inline int globalX() const { return m_globalPos.x(); }
608 inline int globalY() const { return m_globalPos.y(); }
609
610 inline const QPoint& pos() const { return m_pos; }
611 inline const QPoint& globalPos() const { return m_globalPos; }
612
613 inline Reason reason() const { return Reason(m_reason); }
614
615protected:
619};
620#endif // QT_NO_CONTEXTMENU
621
622#ifndef QT_NO_INPUTMETHOD
623class Q_GUI_EXPORT QInputMethodEvent : public QEvent
624{
626public:
632 Selection
633 };
634 class Attribute {
635 public:
636 Attribute(AttributeType typ, int s, int l, QVariant val) : type(typ), start(s), length(l), value(std::move(val)) {}
637 Attribute(AttributeType typ, int s, int l) : type(typ), start(s), length(l), value() {}
638
640 int start;
643 };
645 QInputMethodEvent(const QString &preeditText, const QList<Attribute> &attributes);
646
647 void setCommitString(const QString &commitString, int replaceFrom = 0, int replaceLength = 0);
648 inline const QList<Attribute> &attributes() const { return m_attributes; }
649 inline const QString &preeditString() const { return m_preedit; }
650
651 inline const QString &commitString() const { return m_commit; }
652 inline int replacementStart() const { return m_replacementStart; }
653 inline int replacementLength() const { return m_replacementLength; }
654
655 inline friend bool operator==(const QInputMethodEvent::Attribute &lhs,
657 {
658 return lhs.type == rhs.type && lhs.start == rhs.start
659 && lhs.length == rhs.length && lhs.value == rhs.value;
660 }
661
662 inline friend bool operator!=(const QInputMethodEvent::Attribute &lhs,
664 {
665 return !(lhs == rhs);
666 }
667
668private:
669 QString m_preedit;
670 QString m_commit;
671 QList<Attribute> m_attributes;
672 int m_replacementStart;
673 int m_replacementLength;
674};
676
677class Q_GUI_EXPORT QInputMethodQueryEvent : public QEvent
678{
680public:
681 explicit QInputMethodQueryEvent(Qt::InputMethodQueries queries);
682
683 Qt::InputMethodQueries queries() const { return m_queries; }
684
687private:
688 Qt::InputMethodQueries m_queries;
689 struct QueryPair {
692 };
694 QList<QueryPair> m_values;
695};
696Q_DECLARE_TYPEINFO(QInputMethodQueryEvent::QueryPair, Q_RELOCATABLE_TYPE);
697
698#endif // QT_NO_INPUTMETHOD
699
700#if QT_CONFIG(draganddrop)
701
702class QMimeData;
703
704class Q_GUI_EXPORT QDropEvent : public QEvent
705{
706 Q_DECL_EVENT_COMMON(QDropEvent)
707public:
708 QDropEvent(const QPointF& pos, Qt::DropActions actions, const QMimeData *data,
709 Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Type type = Drop);
710
711#if QT_DEPRECATED_SINCE(6, 0)
712 QT_DEPRECATED_VERSION_X_6_0("Use position().toPoint()")
713 inline QPoint pos() const { return position().toPoint(); }
714 QT_DEPRECATED_VERSION_X_6_0("Use position()")
715 inline QPointF posF() const { return position(); }
716 QT_DEPRECATED_VERSION_X_6_0("Use buttons()")
717 inline Qt::MouseButtons mouseButtons() const { return buttons(); }
718 QT_DEPRECATED_VERSION_X_6_0("Use modifiers()")
719 inline Qt::KeyboardModifiers keyboardModifiers() const { return modifiers(); }
720#endif // QT_DEPRECATED_SINCE(6, 0)
721
722 QPointF position() const { return m_pos; }
723 inline Qt::MouseButtons buttons() const { return m_mouseState; }
724 inline Qt::KeyboardModifiers modifiers() const { return m_modState; }
725
726 inline Qt::DropActions possibleActions() const { return m_actions; }
727 inline Qt::DropAction proposedAction() const { return m_defaultAction; }
728 inline void acceptProposedAction() { m_dropAction = m_defaultAction; accept(); }
729
730 inline Qt::DropAction dropAction() const { return m_dropAction; }
731 void setDropAction(Qt::DropAction action);
732
733 QObject* source() const;
734 inline const QMimeData *mimeData() const { return m_data; }
735
736protected:
737 friend class QApplication;
738 QPointF m_pos;
739 Qt::MouseButtons m_mouseState;
740 Qt::KeyboardModifiers m_modState;
741 Qt::DropActions m_actions;
742 Qt::DropAction m_dropAction;
743 Qt::DropAction m_defaultAction;
744 const QMimeData *m_data;
745};
746
747
748class Q_GUI_EXPORT QDragMoveEvent : public QDropEvent
749{
750 Q_DECL_EVENT_COMMON(QDragMoveEvent)
751public:
752 QDragMoveEvent(const QPoint &pos, Qt::DropActions actions, const QMimeData *data,
753 Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Type type = DragMove);
754
755 inline QRect answerRect() const { return m_rect; }
756
757 inline void accept() { QDropEvent::accept(); }
758 inline void ignore() { QDropEvent::ignore(); }
759
760 inline void accept(const QRect & r) { accept(); m_rect = r; }
761 inline void ignore(const QRect & r) { ignore(); m_rect = r; }
762
763protected:
764 QRect m_rect;
765};
766
767
768class Q_GUI_EXPORT QDragEnterEvent : public QDragMoveEvent
769{
770 Q_DECL_EVENT_COMMON(QDragEnterEvent)
771public:
772 QDragEnterEvent(const QPoint &pos, Qt::DropActions actions, const QMimeData *data,
773 Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers);
774};
775
776
777class Q_GUI_EXPORT QDragLeaveEvent : public QEvent
778{
779 Q_DECL_EVENT_COMMON(QDragLeaveEvent)
780public:
781 QDragLeaveEvent();
782};
783#endif // QT_CONFIG(draganddrop)
784
785
786class Q_GUI_EXPORT QHelpEvent : public QEvent
787{
789public:
790 QHelpEvent(Type type, const QPoint &pos, const QPoint &globalPos);
791
792 inline int x() const { return m_pos.x(); }
793 inline int y() const { return m_pos.y(); }
794 inline int globalX() const { return m_globalPos.x(); }
795 inline int globalY() const { return m_globalPos.y(); }
796
797 inline const QPoint& pos() const { return m_pos; }
798 inline const QPoint& globalPos() const { return m_globalPos; }
799
800private:
801 QPoint m_pos;
802 QPoint m_globalPos;
803};
804
805#ifndef QT_NO_STATUSTIP
806class Q_GUI_EXPORT QStatusTipEvent : public QEvent
807{
809public:
810 explicit QStatusTipEvent(const QString &tip);
811
812 inline QString tip() const { return m_tip; }
813private:
814 QString m_tip;
815};
816#endif
817
818#if QT_CONFIG(whatsthis)
819class Q_GUI_EXPORT QWhatsThisClickedEvent : public QEvent
820{
821 Q_DECL_EVENT_COMMON(QWhatsThisClickedEvent)
822public:
823 explicit QWhatsThisClickedEvent(const QString &href);
824
825 inline QString href() const { return m_href; }
826private:
827 QString m_href;
828};
829#endif
830
831#if QT_CONFIG(action)
832class Q_GUI_EXPORT QActionEvent : public QEvent
833{
835public:
836 QActionEvent(int type, QAction *action, QAction *before = nullptr);
837
838 inline QAction *action() const { return m_action; }
839 inline QAction *before() const { return m_before; }
840private:
841 QAction *m_action;
842 QAction *m_before;
843};
844#endif // QT_CONFIG(action)
845
846class Q_GUI_EXPORT QFileOpenEvent : public QEvent
847{
849public:
850 explicit QFileOpenEvent(const QString &file);
851 explicit QFileOpenEvent(const QUrl &url);
852
853 inline QString file() const { return m_file; }
854 QUrl url() const { return m_url; }
855#if QT_DEPRECATED_SINCE(6, 6)
856 QT_DEPRECATED_VERSION_X_6_6("Interpret the string returned by file()")
857 bool openFile(QFile &file, QIODevice::OpenMode flags) const;
858#endif
859private:
860 QString m_file;
861 QUrl m_url;
862};
863
864#ifndef QT_NO_TOOLBAR
865class Q_GUI_EXPORT QToolBarChangeEvent : public QEvent
866{
868public:
869 explicit QToolBarChangeEvent(bool t);
870
871 inline bool toggle() const { return m_toggle; }
872private:
873 bool m_toggle;
874};
875#endif
876
877#if QT_CONFIG(shortcut)
878class Q_GUI_EXPORT QShortcutEvent : public QEvent
879{
881public:
882 // Note this is publicly deprecated, but should remain as internal constructor:
883 QShortcutEvent(const QKeySequence &key, int id, bool ambiguous = false);
884 QShortcutEvent(const QKeySequence &key, const QShortcut *shortcut = nullptr, bool ambiguous = false);
885
886 inline const QKeySequence &key() const { return m_sequence; }
887 // Note this is publicly deprecated, but should remain as internal getter:
888 inline int shortcutId() const { return m_shortcutId; }
889 inline bool isAmbiguous() const { return m_ambiguous; }
890protected:
891 QKeySequence m_sequence;
892 int m_shortcutId;
893 bool m_ambiguous;
894};
895#endif
896
897class Q_GUI_EXPORT QWindowStateChangeEvent: public QEvent
898{
900public:
901 explicit QWindowStateChangeEvent(Qt::WindowStates oldState, bool isOverride = false);
902
903 inline Qt::WindowStates oldState() const { return m_oldStates; }
904 bool isOverride() const;
905
906private:
907 Qt::WindowStates m_oldStates;
908 bool m_override;
909};
910
911#ifndef QT_NO_DEBUG_STREAM
912Q_GUI_EXPORT QDebug operator<<(QDebug, const QEvent *);
913#endif
914
915class Q_GUI_EXPORT QTouchEvent : public QPointerEvent
916{
918public:
919 using TouchPoint = QEventPoint; // source compat
920
921 explicit QTouchEvent(QEvent::Type eventType,
922 const QPointingDevice *device = nullptr,
923 Qt::KeyboardModifiers modifiers = Qt::NoModifier,
924 const QList<QEventPoint> &touchPoints = {});
925#if QT_DEPRECATED_SINCE(6, 0)
926 QT_DEPRECATED_VERSION_X_6_0("Use another constructor")
927 explicit QTouchEvent(QEvent::Type eventType,
928 const QPointingDevice *device,
929 Qt::KeyboardModifiers modifiers,
930 QEventPoint::States touchPointStates,
931 const QList<QEventPoint> &touchPoints = {});
932#endif
933
934 inline QObject *target() const { return m_target; }
935 inline QEventPoint::States touchPointStates() const { return m_touchPointStates; }
936#if QT_DEPRECATED_SINCE(6, 0)
937 QT_DEPRECATED_VERSION_X_6_0("Use points()")
938 const QList<QEventPoint> &touchPoints() const { return points(); }
939#endif
940 bool isBeginEvent() const override;
941 bool isUpdateEvent() const override;
942 bool isEndEvent() const override;
943
944protected:
945 QObject *m_target = nullptr;
946 QEventPoint::States m_touchPointStates = QEventPoint::State::Unknown;
948};
949
950class Q_GUI_EXPORT QScrollPrepareEvent : public QEvent
951{
953public:
954 explicit QScrollPrepareEvent(const QPointF &startPos);
955
956 QPointF startPos() const { return m_startPos; }
957
958 QSizeF viewportSize() const { return m_viewportSize; }
959 QRectF contentPosRange() const { return m_contentPosRange; }
960 QPointF contentPos() const { return m_contentPos; }
961
962 void setViewportSize(const QSizeF &size);
963 void setContentPosRange(const QRectF &rect);
964 void setContentPos(const QPointF &pos);
965
966private:
967 QRectF m_contentPosRange;
968 QSizeF m_viewportSize;
969 QPointF m_startPos;
970 QPointF m_contentPos;
971};
972
973
974class Q_GUI_EXPORT QScrollEvent : public QEvent
975{
977public:
979 {
982 ScrollFinished
983 };
984
985 QScrollEvent(const QPointF &contentPos, const QPointF &overshoot, ScrollState scrollState);
986
987 QPointF contentPos() const { return m_contentPos; }
988 QPointF overshootDistance() const { return m_overshoot; }
989 ScrollState scrollState() const { return m_state; }
990
991private:
992 QPointF m_contentPos;
993 QPointF m_overshoot;
995};
996
997class Q_GUI_EXPORT QScreenOrientationChangeEvent : public QEvent
998{
1000public:
1002
1003 QScreen *screen() const { return m_screen; }
1004 Qt::ScreenOrientation orientation() const { return m_orientation; }
1005
1006private:
1007 QScreen *m_screen;
1008 Qt::ScreenOrientation m_orientation;
1009};
1010
1011class Q_GUI_EXPORT QApplicationStateChangeEvent : public QEvent
1012{
1014public:
1016
1017 Qt::ApplicationState applicationState() const { return m_applicationState; }
1018
1019private:
1020 Qt::ApplicationState m_applicationState;
1021};
1022
1024
1025#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:1017
The QApplication class manages the GUI application's control flow and main settings.
The QCloseEvent class contains parameters that describe a close event.
Definition qevent.h:561
The QContextMenuEvent class contains parameters that describe a context menu event.
Definition qevent.h:593
int y() const
Returns the y position of the mouse pointer, relative to the widget that received the event.
Definition qevent.h:606
const QPoint & pos() const
Returns the position of the mouse pointer relative to the widget that received the event.
Definition qevent.h:610
const QPoint & globalPos() const
Returns the global position of the mouse pointer at the time of the event.
Definition qevent.h:611
int x() const
Returns the x position of the mouse pointer, relative to the widget that received the event.
Definition qevent.h:605
int globalY() const
Returns the global y position of the mouse pointer at the time of the event.
Definition qevent.h:608
QPoint m_globalPos
Definition qevent.h:617
int globalX() const
Returns the global x position of the mouse pointer at the time of the event.
Definition qevent.h:607
Reason
This enum describes the reason why the event was sent.
Definition qevent.h:596
Reason reason() const
Returns the reason for this context event.
Definition qevent.h:613
\inmodule QtCore
\inmodule QtGui
Definition qevent.h:164
The QEventPoint class provides information about a point in a QPointerEvent.
Definition qeventpoint.h:20
\inmodule QtCore
Definition qcoreevent.h:45
virtual void setAccepted(bool accepted)
Definition qcoreevent.h:302
Type
This enum type defines the valid event types in Qt.
Definition qcoreevent.h:51
@ FocusOut
Definition qcoreevent.h:67
@ FocusIn
Definition qcoreevent.h:66
Type type() const
Returns the event type.
Definition qcoreevent.h:299
void ignore()
Clears the accept flag parameter of the event object, the equivalent of calling setAccepted(false).
Definition qcoreevent.h:306
void accept()
Sets the accept flag of the event object, the equivalent of calling setAccepted(true).
Definition qcoreevent.h:305
The QExposeEvent class contains event parameters for expose events. \inmodule QtGui.
Definition qevent.h:514
QRegion m_region
Definition qevent.h:525
The QFileOpenEvent class provides an event that will be sent when there is a request to open a file o...
Definition qevent.h:847
QUrl url() const
Returns the url that the application should open.
Definition qevent.h:854
QString file() const
Returns the name of the file that the application should open.
Definition qevent.h:853
\inmodule QtCore
Definition qfile.h:93
The QFocusEvent class contains event parameters for widget focus events.
Definition qevent.h:469
bool lostFocus() const
Returns true if type() is QEvent::FocusOut; otherwise returns false.
Definition qevent.h:475
bool gotFocus() const
Returns true if type() is QEvent::FocusIn; otherwise returns false.
Definition qevent.h:474
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:787
int x() const
Same as pos().x().
Definition qevent.h:792
const QPoint & globalPos() const
Returns the mouse cursor position when the event was generated in global coordinates.
Definition qevent.h:798
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:797
int y() const
Same as pos().y().
Definition qevent.h:793
int globalY() const
Same as globalPos().y().
Definition qevent.h:795
int globalX() const
Same as globalPos().x().
Definition qevent.h:794
The QHideEvent class provides an event which is sent after a widget is hidden.
Definition qevent.h:585
\inmodule QtGui
Definition qevent.h:245
QPoint oldPos() const
Returns the previous position of the mouse cursor, relative to the widget that received the event.
Definition qevent.h:271
QPointF oldPosF() const
Returns the previous position of the mouse cursor, relative to the widget that received the event.
Definition qevent.h:272
bool isUpdateEvent() const override
Definition qevent.h:268
QPointF m_oldPos
Definition qevent.h:275
\inmodule QtCore \reentrant
Definition qiodevice.h:34
The QIconDragEvent class indicates that a main icon drag has begun.
Definition qevent.h:569
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:636
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:637
The QInputMethodEvent class provides parameters for input method events.
Definition qevent.h:624
const QString & preeditString() const
Returns the preedit text, i.e.
Definition qevent.h:649
int replacementLength() const
Returns the number of characters to be replaced in the preedit string.
Definition qevent.h:653
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:651
int replacementStart() const
Returns the position at which characters are to be replaced relative from the start of the preedit st...
Definition qevent.h:652
friend bool operator!=(const QInputMethodEvent::Attribute &lhs, const QInputMethodEvent::Attribute &rhs)
Definition qevent.h:662
friend bool operator==(const QInputMethodEvent::Attribute &lhs, const QInputMethodEvent::Attribute &rhs)
Definition qevent.h:655
const QList< Attribute > & attributes() const
Returns the list of attributes passed to the QInputMethodEvent constructor.
Definition qevent.h:648
AttributeType
\value TextFormat A QTextCharFormat for the part of the preedit string specified by start and length.
Definition qevent.h:627
The QInputMethodQueryEvent class provides an event sent by the input context to input objects.
Definition qevent.h:678
Qt::InputMethodQueries queries() const
Returns the properties queried by the event.
Definition qevent.h:683
The QKeyEvent class describes a key event.
Definition qevent.h:423
quint16 m_autoRepeat
Definition qevent.h:464
int count() const
Returns the number of keys involved in this event.
Definition qevent.h:444
quint32 m_virtualKey
Definition qevent.h:461
quint32 nativeScanCode() const
Definition qevent.h:446
QString text() const
Returns the Unicode text that this key generated.
Definition qevent.h:442
quint16 m_count
Definition qevent.h:463
quint32 nativeVirtualKey() const
Definition qevent.h:447
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:443
QString m_text
Definition qevent.h:458
quint32 m_nativeModifiers
Definition qevent.h:462
quint32 nativeModifiers() const
Definition qevent.h:448
int key() const
Returns the code of the key that was pressed or released.
Definition qevent.h:433
quint32 m_scanCode
Definition qevent.h:460
QKeyCombination keyCombination() const
Returns a QKeyCombination object containing both the key() and the modifiers() carried by this event.
Definition qevent.h:438
int m_key
Definition qevent.h:459
The QKeySequence class encapsulates a key sequence as used by shortcuts.
Definition qlist.h:74
\inmodule QtCore
Definition qmimedata.h:16
\inmodule QtGui
Definition qevent.h:195
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:218
The QMoveEvent class contains event parameters for move events.
Definition qevent.h:501
const QPoint & oldPos() const
Returns the old position of the widget.
Definition qevent.h:507
QPoint m_oldPos
Definition qevent.h:509
const QPoint & pos() const
Returns the new position of the widget.
Definition qevent.h:506
The QNativeGestureEvent class contains parameters that describe a gesture event. \inmodule QtGui.
\inmodule QtCore
Definition qobject.h:90
The QPaintEvent class contains event parameters for paint events.
Definition qevent.h:485
bool m_erased
Definition qevent.h:497
const QRegion & region() const
Returns the region that needs to be updated.
Definition qevent.h:492
QRect m_rect
Definition qevent.h:495
const QRect & rect() const
Returns the rectangle that needs to be updated.
Definition qevent.h:491
QRegion m_region
Definition qevent.h:496
The QPlatformSurfaceEvent class is used to notify about native platform surface events....
Definition qevent.h:530
SurfaceEventType
This enum describes the type of platform surface event.
Definition qevent.h:533
SurfaceEventType m_surfaceEventType
Definition qevent.h:543
SurfaceEventType surfaceEventType() const
Returns the specific type of platform surface event.
Definition qevent.h:540
\inmodule QtCore\reentrant
Definition qpoint.h:214
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:394
\inmodule QtCore\reentrant
Definition qpoint.h:23
A base class for pointer events.
Definition qevent.h:73
virtual bool isEndEvent() const
Definition qevent.h:91
qsizetype pointCount() const
Returns the number of points in this pointer event.
Definition qevent.h:84
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:366
virtual bool isBeginEvent() const
Definition qevent.h:89
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:348
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:80
const QList< QEventPoint > & points() const
Returns a list of points in this pointer event.
Definition qevent.h:86
QPointerEvent(Type type, SinglePointEventTag, const QInputDevice *dev, Qt::KeyboardModifiers modifiers=Qt::NoModifier)
virtual bool isUpdateEvent() const
Definition qevent.h:90
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:483
\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:547
QSize m_oldSize
Definition qevent.h:555
const QSize & oldSize() const
Returns the old size of the widget.
Definition qevent.h:553
const QSize & size() const
Returns the new size of the widget.
Definition qevent.h:552
QScreen * screen() const
Returns the screen whose orientation changed.
Definition qevent.h:1003
Qt::ScreenOrientation orientation() const
Returns the orientation of the screen.
Definition qevent.h:1004
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:975
ScrollState scrollState() const
Returns the current scroll state as a combination of ScrollStateFlag values.
Definition qevent.h:989
QPointF contentPos() const
Returns the new scroll position.
Definition qevent.h:987
QPointF overshootDistance() const
Returns the new overshoot distance.
Definition qevent.h:988
ScrollState
This enum describes the states a scroll event can have.
Definition qevent.h:979
@ ScrollStarted
Definition qevent.h:980
@ ScrollUpdated
Definition qevent.h:981
The QScrollPrepareEvent class is sent in preparation of scrolling.
Definition qevent.h:951
QPointF contentPos() const
Returns the current position of the content as set by setContentPos.
Definition qevent.h:960
QPointF startPos() const
Returns the position of the touch or mouse event that started the scrolling.
Definition qevent.h:956
QRectF contentPosRange() const
Returns the range of coordinates for the content as set by setContentPosRange().
Definition qevent.h:959
QSizeF viewportSize() const
Returns size of the area that is to be scrolled as set by setViewportSize.
Definition qevent.h:958
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:577
A base class for pointer events containing a single point, such as mouse events.
Definition qevent.h:108
quint16 m_reserved2
Definition qevent.h:155
QPointF globalPosition() const
Returns the position of the point in this event on the screen or virtual desktop.
Definition qevent.h:122
Qt::MouseEventSource m_source
Definition qevent.h:147
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:118
quint16 m_invertedScrolling
Definition qevent.h:160
void setExclusivePointGrabber(QObject *exclusiveGrabber)
Definition qevent.h:131
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:157
quint16 m_reserved
Definition qevent.h:154
QPointF scenePosition() const
Returns the position of the point in this event, relative to the window or scene.
Definition qevent.h:120
Qt::MouseButton button() const
Returns the button that caused the event.
Definition qevent.h:115
Qt::MouseButtons buttons() const
Returns the button state when the event was generated.
Definition qevent.h:116
QObject * exclusivePointGrabber() const
Definition qevent.h:129
quint16 m_phase
Definition qevent.h:159
\inmodule QtCore
Definition qsize.h:207
\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:807
QString tip() const
Returns the message to show in the status bar.
Definition qevent.h:812
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
The QToolBarChangeEvent class provides an event that is sent whenever a the toolbar button is clicked...
Definition qevent.h:866
bool toggle() const
Definition qevent.h:871
The QTouchEvent class contains parameters that describe a touch event.
Definition qevent.h:916
QObject * target() const
Returns the target object within the window on which the event occurred.
Definition qevent.h:934
QEventPoint::States touchPointStates() const
Returns a bitwise OR of all the touch point states for this event.
Definition qevent.h:935
quint32 m_reserved
Definition qevent.h:947
\inmodule QtCore
Definition qurl.h:94
\inmodule QtCore
Definition qvariant.h:64
The QVector2D class represents a vector or vertex in 2D space.
Definition qvectornd.h:31
\inmodule QtGui
Definition qevent.h:898
Qt::WindowStates oldState() const
Returns the state of the window before the change.
Definition qevent.h:903
EGLImageKHR int int EGLuint64KHR * modifiers
QString text
QPushButton * button
[2]
double e
rect
[4]
else opt state
[0]
Combined button and popup list for selecting options.
InputMethodQuery
MouseButton
Definition qnamespace.h:55
@ NoButton
Definition qnamespace.h:56
MouseEventSource
@ MouseEventNotSynthesized
ScreenOrientation
Definition qnamespace.h:270
@ NoModifier
DropAction
ApplicationState
Definition qnamespace.h:261
NativeGestureType
ScrollPhase
FocusReason
@ OtherFocusReason
#define Q_DECL_EVENT_COMMON(Class)
Definition qcoreevent.h:20
static bool openFile(const QString &fileName, QFile &file)
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
Q_GUI_EXPORT QDebug operator<<(QDebug, const QEvent *)
Definition qevent.cpp:4040
int qRound(qfloat16 d) noexcept
Definition qfloat16.h:281
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
GLenum type
GLbitfield flags
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLuint start
GLint first
GLint y
GLsizei GLsizei GLchar * source
GLfixed GLfixed GLint GLint GLfixed points
GLenum query
GLuint GLfloat * val
GLdouble GLdouble t
Definition qopenglext.h:243
GLdouble s
[6]
Definition qopenglext.h:235
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
bool operator==(const QRandomGenerator &rng1, const QRandomGenerator &rng2)
Definition qrandom.cpp:1219
#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:145
#define Q_DECLARE_TYPEINFO(TYPE, FLAGS)
Definition qtypeinfo.h:163
unsigned int quint32
Definition qtypes.h:45
unsigned short quint16
Definition qtypes.h:43
unsigned long long quint64
Definition qtypes.h:56
ptrdiff_t qsizetype
Definition qtypes.h:70
unsigned int uint
Definition qtypes.h:29
long long qint64
Definition qtypes.h:55
double qreal
Definition qtypes.h:92
#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:24