1 /****************************************************************************
3 ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
6 ** This file is part of the QtGui module of the Qt Toolkit.
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
40 ****************************************************************************/
45 #include <QtGui/qwindowdefs.h>
46 #include <QtCore/qobject.h>
47 #include <QtGui/qregion.h>
48 #include <QtCore/qnamespace.h>
49 #include <QtCore/qstring.h>
50 #include <QtGui/qkeysequence.h>
51 #include <QtCore/qcoreevent.h>
52 #include <QtCore/qvariant.h>
53 #include <QtCore/qmap.h>
54 #include <QtCore/qvector.h>
55 #include <QtCore/qset.h>
56 #include <QtCore/qurl.h>
57 #include <QtCore/qfile.h>
58 #include <QtGui/qvector2d.h>
59 #include <QtGui/qtouchdevice.h>
67 #ifndef QT_NO_GESTURES
72 class Q_GUI_EXPORT QInputEvent : public QEvent
75 explicit QInputEvent(Type type, Qt::KeyboardModifiers modifiers = Qt::NoModifier);
77 inline Qt::KeyboardModifiers modifiers() const { return modState; }
78 inline void setModifiers(Qt::KeyboardModifiers amodifiers) { modState = amodifiers; }
79 inline ulong timestamp() const { return ts; }
80 inline void setTimestamp(ulong atimestamp) { ts = atimestamp; }
82 Qt::KeyboardModifiers modState;
86 class Q_GUI_EXPORT QMouseEvent : public QInputEvent
89 QMouseEvent(Type type, const QPointF &localPos, Qt::MouseButton button,
90 Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers);
91 QMouseEvent(Type type, const QPointF &localPos, const QPointF &screenPos,
92 Qt::MouseButton button, Qt::MouseButtons buttons,
93 Qt::KeyboardModifiers modifiers);
94 QMouseEvent(Type type, const QPointF &localPos, const QPointF &windowPos, const QPointF &screenPos,
95 Qt::MouseButton button, Qt::MouseButtons buttons,
96 Qt::KeyboardModifiers modifiers);
99 #ifndef QT_NO_INTEGER_EVENT_COORDINATES
100 inline QPoint pos() const { return l.toPoint(); }
101 inline QPoint globalPos() const { return s.toPoint(); }
102 inline int x() const { return qRound(l.x()); }
103 inline int y() const { return qRound(l.y()); }
104 inline int globalX() const { return qRound(s.x()); }
105 inline int globalY() const { return qRound(s.y()); }
107 const QPointF &localPos() const { return l; }
108 const QPointF &windowPos() const { return w; }
109 const QPointF &screenPos() const { return s; }
111 inline Qt::MouseButton button() const { return b; }
112 inline Qt::MouseButtons buttons() const { return mouseState; }
114 #if QT_DEPRECATED_SINCE(5, 0)
115 QT_DEPRECATED inline QPointF posF() const { return l; }
121 Qt::MouseButtons mouseState;
125 friend class QGuiApplicationPrivate;
128 class Q_GUI_EXPORT QHoverEvent : public QInputEvent
131 QHoverEvent(Type type, const QPointF &pos, const QPointF &oldPos, Qt::KeyboardModifiers modifiers = Qt::NoModifier);
134 #ifndef QT_NO_INTEGER_EVENT_COORDINATES
135 inline QPoint pos() const { return p.toPoint(); }
136 inline QPoint oldPos() const { return op.toPoint(); }
139 inline const QPointF &posF() const { return p; }
140 inline const QPointF &oldPosF() const { return op; }
146 #ifndef QT_NO_WHEELEVENT
147 class Q_GUI_EXPORT QWheelEvent : public QInputEvent
150 QWheelEvent(const QPointF &pos, int delta,
151 Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers,
152 Qt::Orientation orient = Qt::Vertical);
153 QWheelEvent(const QPointF &pos, const QPointF& globalPos, int delta,
154 Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers,
155 Qt::Orientation orient = Qt::Vertical);
156 QWheelEvent(const QPointF &pos, const QPointF& globalPos,
157 QPoint pixelDelta, QPoint angleDelta, int qt4Delta, Qt::Orientation qt4Orientation,
158 Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers);
163 inline QPoint pixelDelta() const { return pixelD; }
164 inline QPoint angleDelta() const { return angleD; }
166 inline int delta() const { return qt4D; }
167 inline Qt::Orientation orientation() const { return qt4O; }
169 #ifndef QT_NO_INTEGER_EVENT_COORDINATES
170 inline QPoint pos() const { return p.toPoint(); }
171 inline QPoint globalPos() const { return g.toPoint(); }
172 inline int x() const { return p.x(); }
173 inline int y() const { return p.y(); }
174 inline int globalX() const { return g.x(); }
175 inline int globalY() const { return g.y(); }
177 inline const QPointF &posF() const { return p; }
178 inline const QPointF &globalPosF() const { return g; }
180 inline Qt::MouseButtons buttons() const { return mouseState; }
187 Qt::Orientation qt4O;
188 Qt::MouseButtons mouseState;
193 #ifndef QT_NO_TABLETEVENT
194 class Q_GUI_EXPORT QTabletEvent : public QInputEvent
197 enum TabletDevice { NoDevice, Puck, Stylus, Airbrush, FourDMouse,
198 XFreeEraser /*internal*/, RotationStylus };
199 enum PointerType { UnknownPointer, Pen, Cursor, Eraser };
200 QTabletEvent(Type t, const QPointF &pos, const QPointF &globalPos,
201 int device, int pointerType, qreal pressure, int xTilt, int yTilt,
202 qreal tangentialPressure, qreal rotation, int z,
203 Qt::KeyboardModifiers keyState, qint64 uniqueID);
206 inline QPoint pos() const { return mPos.toPoint(); }
207 inline QPoint globalPos() const { return mGPos.toPoint(); }
208 #if QT_DEPRECATED_SINCE(5,0)
209 QT_DEPRECATED inline const QPointF &hiResGlobalPos() const { return mPos; }
212 inline const QPointF &posF() const { return mPos; }
213 inline const QPointF &globalPosF() const { return mGPos; }
215 inline int x() const { return qRound(mPos.x()); }
216 inline int y() const { return qRound(mPos.y()); }
217 inline int globalX() const { return qRound(mGPos.x()); }
218 inline int globalY() const { return qRound(mGPos.y()); }
219 inline qreal hiResGlobalX() const { return mGPos.x(); }
220 inline qreal hiResGlobalY() const { return mGPos.y(); }
221 inline TabletDevice device() const { return TabletDevice(mDev); }
222 inline PointerType pointerType() const { return PointerType(mPointerType); }
223 inline qint64 uniqueId() const { return mUnique; }
224 inline qreal pressure() const { return mPress; }
225 inline int z() const { return mZ; }
226 inline qreal tangentialPressure() const { return mTangential; }
227 inline qreal rotation() const { return mRot; }
228 inline int xTilt() const { return mXT; }
229 inline int yTilt() const { return mYT; }
233 int mDev, mPointerType, mXT, mYT, mZ;
234 qreal mPress, mTangential, mRot;
237 // I don't know what the future holds for tablets but there could be some
238 // new devices coming along, and there seem to be "holes" in the
239 // OS-specific events for this.
242 #endif // QT_NO_TABLETEVENT
244 class Q_GUI_EXPORT QKeyEvent : public QInputEvent
247 QKeyEvent(Type type, int key, Qt::KeyboardModifiers modifiers, const QString& text = QString(),
248 bool autorep = false, ushort count = 1);
249 QKeyEvent(Type type, int key, Qt::KeyboardModifiers modifiers,
250 quint32 nativeScanCode, quint32 nativeVirtualKey, quint32 nativeModifiers,
251 const QString &text = QString(), bool autorep = false, ushort count = 1);
254 int key() const { return k; }
255 #ifndef QT_NO_SHORTCUT
256 bool matches(QKeySequence::StandardKey key) const;
258 Qt::KeyboardModifiers modifiers() const;
259 inline QString text() const { return txt; }
260 inline bool isAutoRepeat() const { return autor; }
261 inline int count() const { return int(c); }
263 inline quint32 nativeScanCode() const { return nScanCode; }
264 inline quint32 nativeVirtualKey() const { return nVirtualKey; }
265 inline quint32 nativeModifiers() const { return nModifiers; }
267 // Functions for the extended key event information
268 #if QT_DEPRECATED_SINCE(5, 0)
269 static inline QKeyEvent *createExtendedKeyEvent(Type type, int key, Qt::KeyboardModifiers modifiers,
270 quint32 nativeScanCode, quint32 nativeVirtualKey,
271 quint32 nativeModifiers,
272 const QString& text = QString(), bool autorep = false,
275 return new QKeyEvent(type, key, modifiers,
276 nativeScanCode, nativeVirtualKey, nativeModifiers,
277 text, autorep, count);
280 inline bool hasExtendedInfo() const { return true; }
291 // ushort reserved:15;
295 class Q_GUI_EXPORT QFocusEvent : public QEvent
298 explicit QFocusEvent(Type type, Qt::FocusReason reason=Qt::OtherFocusReason);
301 inline bool gotFocus() const { return type() == FocusIn; }
302 inline bool lostFocus() const { return type() == FocusOut; }
304 Qt::FocusReason reason() const;
307 Qt::FocusReason m_reason;
311 class Q_GUI_EXPORT QPaintEvent : public QEvent
314 explicit QPaintEvent(const QRegion& paintRegion);
315 explicit QPaintEvent(const QRect &paintRect);
318 inline const QRect &rect() const { return m_rect; }
319 inline const QRegion ®ion() const { return m_region; }
322 friend class QApplication;
323 friend class QCoreApplication;
329 class Q_GUI_EXPORT QMoveEvent : public QEvent
332 QMoveEvent(const QPoint &pos, const QPoint &oldPos);
335 inline const QPoint &pos() const { return p; }
336 inline const QPoint &oldPos() const { return oldp;}
339 friend class QApplication;
340 friend class QCoreApplication;
343 class Q_GUI_EXPORT QExposeEvent : public QEvent
346 explicit QExposeEvent(const QRegion &rgn);
349 inline const QRegion ®ion() const { return rgn; }
355 class Q_GUI_EXPORT QResizeEvent : public QEvent
358 QResizeEvent(const QSize &size, const QSize &oldSize);
361 inline const QSize &size() const { return s; }
362 inline const QSize &oldSize()const { return olds;}
365 friend class QApplication;
366 friend class QCoreApplication;
370 class Q_GUI_EXPORT QCloseEvent : public QEvent
378 class Q_GUI_EXPORT QIconDragEvent : public QEvent
386 class Q_GUI_EXPORT QShowEvent : public QEvent
394 class Q_GUI_EXPORT QHideEvent : public QEvent
401 #ifndef QT_NO_CONTEXTMENU
402 class Q_GUI_EXPORT QContextMenuEvent : public QInputEvent
405 enum Reason { Mouse, Keyboard, Other };
407 QContextMenuEvent(Reason reason, const QPoint &pos, const QPoint &globalPos,
408 Qt::KeyboardModifiers modifiers);
409 QContextMenuEvent(Reason reason, const QPoint &pos, const QPoint &globalPos);
410 QContextMenuEvent(Reason reason, const QPoint &pos);
411 ~QContextMenuEvent();
413 inline int x() const { return p.x(); }
414 inline int y() const { return p.y(); }
415 inline int globalX() const { return gp.x(); }
416 inline int globalY() const { return gp.y(); }
418 inline const QPoint& pos() const { return p; }
419 inline const QPoint& globalPos() const { return gp; }
421 inline Reason reason() const { return Reason(reas); }
428 #endif // QT_NO_CONTEXTMENU
430 #ifndef QT_NO_INPUTMETHOD
431 class Q_GUI_EXPORT QInputMethodEvent : public QEvent
443 Attribute(AttributeType t, int s, int l, QVariant val) : type(t), start(s), length(l), value(val) {}
451 QInputMethodEvent(const QString &preeditText, const QList<Attribute> &attributes);
452 void setCommitString(const QString &commitString, int replaceFrom = 0, int replaceLength = 0);
453 inline const QList<Attribute> &attributes() const { return attrs; }
454 inline const QString &preeditString() const { return preedit; }
456 inline const QString &commitString() const { return commit; }
457 inline int replacementStart() const { return replace_from; }
458 inline int replacementLength() const { return replace_length; }
460 QInputMethodEvent(const QInputMethodEvent &other);
464 QList<Attribute> attrs;
469 Q_DECLARE_TYPEINFO(QInputMethodEvent::Attribute, Q_MOVABLE_TYPE);
471 class Q_GUI_EXPORT QInputMethodQueryEvent : public QEvent
474 explicit QInputMethodQueryEvent(Qt::InputMethodQueries queries);
475 ~QInputMethodQueryEvent();
477 Qt::InputMethodQueries queries() const { return m_queries; }
479 void setValue(Qt::InputMethodQuery query, const QVariant &value);
480 QVariant value(Qt::InputMethodQuery query) const;
482 Qt::InputMethodQueries m_queries;
484 Qt::InputMethodQuery query;
487 QVector<QueryPair> m_values;
490 #endif // QT_NO_INPUTMETHOD
492 #ifndef QT_NO_DRAGANDDROP
496 class Q_GUI_EXPORT QDropEvent : public QEvent
499 QDropEvent(const QPointF& pos, Qt::DropActions actions, const QMimeData *data,
500 Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Type type = Drop);
503 inline QPoint pos() const { return p.toPoint(); }
504 inline const QPointF &posF() const { return p; }
505 inline Qt::MouseButtons mouseButtons() const { return mouseState; }
506 inline Qt::KeyboardModifiers keyboardModifiers() const { return modState; }
508 inline Qt::DropActions possibleActions() const { return act; }
509 inline Qt::DropAction proposedAction() const { return default_action; }
510 inline void acceptProposedAction() { drop_action = default_action; accept(); }
512 inline Qt::DropAction dropAction() const { return drop_action; }
513 void setDropAction(Qt::DropAction action);
515 QObject* source() const;
516 inline const QMimeData *mimeData() const { return mdata; }
519 friend class QApplication;
521 Qt::MouseButtons mouseState;
522 Qt::KeyboardModifiers modState;
524 Qt::DropAction drop_action;
525 Qt::DropAction default_action;
526 const QMimeData *mdata;
530 class Q_GUI_EXPORT QDragMoveEvent : public QDropEvent
533 QDragMoveEvent(const QPoint &pos, Qt::DropActions actions, const QMimeData *data,
534 Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Type type = DragMove);
537 inline QRect answerRect() const { return rect; }
539 inline void accept() { QDropEvent::accept(); }
540 inline void ignore() { QDropEvent::ignore(); }
542 inline void accept(const QRect & r) { accept(); rect = r; }
543 inline void ignore(const QRect & r) { ignore(); rect = r; }
546 friend class QApplication;
551 class Q_GUI_EXPORT QDragEnterEvent : public QDragMoveEvent
554 QDragEnterEvent(const QPoint &pos, Qt::DropActions actions, const QMimeData *data,
555 Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers);
560 class Q_GUI_EXPORT QDragLeaveEvent : public QEvent
566 #endif // QT_NO_DRAGANDDROP
569 class Q_GUI_EXPORT QHelpEvent : public QEvent
572 QHelpEvent(Type type, const QPoint &pos, const QPoint &globalPos);
575 inline int x() const { return p.x(); }
576 inline int y() const { return p.y(); }
577 inline int globalX() const { return gp.x(); }
578 inline int globalY() const { return gp.y(); }
580 inline const QPoint& pos() const { return p; }
581 inline const QPoint& globalPos() const { return gp; }
588 #ifndef QT_NO_STATUSTIP
589 class Q_GUI_EXPORT QStatusTipEvent : public QEvent
592 explicit QStatusTipEvent(const QString &tip);
595 inline QString tip() const { return s; }
601 #ifndef QT_NO_WHATSTHIS
602 class Q_GUI_EXPORT QWhatsThisClickedEvent : public QEvent
605 explicit QWhatsThisClickedEvent(const QString &href);
606 ~QWhatsThisClickedEvent();
608 inline QString href() const { return s; }
615 class Q_GUI_EXPORT QActionEvent : public QEvent
619 QActionEvent(int type, QAction *action, QAction *before = 0);
622 inline QAction *action() const { return act; }
623 inline QAction *before() const { return bef; }
627 class Q_GUI_EXPORT QFileOpenEvent : public QEvent
630 explicit QFileOpenEvent(const QString &file);
631 explicit QFileOpenEvent(const QUrl &url);
634 inline QString file() const { return f; }
635 QUrl url() const { return m_url; }
636 bool openFile(QFile &file, QIODevice::OpenMode flags) const;
642 #ifndef QT_NO_TOOLBAR
643 class Q_GUI_EXPORT QToolBarChangeEvent : public QEvent
646 explicit QToolBarChangeEvent(bool t);
647 ~QToolBarChangeEvent();
649 inline bool toggle() const { return tog; }
655 #ifndef QT_NO_SHORTCUT
656 class Q_GUI_EXPORT QShortcutEvent : public QEvent
659 QShortcutEvent(const QKeySequence &key, int id, bool ambiguous = false);
662 inline const QKeySequence &key() const { return sequence; }
663 inline int shortcutId() const { return sid; }
664 inline bool isAmbiguous() const { return ambig; }
666 QKeySequence sequence;
672 class Q_GUI_EXPORT QWindowStateChangeEvent: public QEvent
675 explicit QWindowStateChangeEvent(Qt::WindowStates aOldState, bool isOverride = false);
676 ~QWindowStateChangeEvent();
678 inline Qt::WindowStates oldState() const { return ostate; }
679 bool isOverride() const;
682 Qt::WindowStates ostate;
686 #ifndef QT_NO_DEBUG_STREAM
687 Q_GUI_EXPORT QDebug operator<<(QDebug, const QEvent *);
690 #ifndef QT_NO_SHORTCUT
691 inline bool operator==(QKeyEvent *e, QKeySequence::StandardKey key){return (e ? e->matches(key) : false);}
692 inline bool operator==(QKeySequence::StandardKey key, QKeyEvent *e){return (e ? e->matches(key) : false);}
693 #endif // QT_NO_SHORTCUT
695 class QTouchEventTouchPointPrivate;
696 class Q_GUI_EXPORT QTouchEvent : public QInputEvent
699 class Q_GUI_EXPORT TouchPoint
705 Q_DECLARE_FLAGS(InfoFlags, InfoFlag)
707 explicit TouchPoint(int id = -1);
708 TouchPoint(const TouchPoint &other);
709 #ifdef Q_COMPILER_RVALUE_REFS
710 TouchPoint(TouchPoint &&other) : d(other.d) { other.d = 0; }
711 TouchPoint &operator=(TouchPoint &&other)
712 { qSwap(d, other.d); return *this; }
716 TouchPoint &operator=(const TouchPoint &other)
717 { if ( d != other.d ) { TouchPoint copy(other); swap(copy); } return *this; }
719 void swap(TouchPoint &other) { qSwap(d, other.d); }
723 Qt::TouchPointState state() const;
726 QPointF startPos() const;
727 QPointF lastPos() const;
729 QPointF scenePos() const;
730 QPointF startScenePos() const;
731 QPointF lastScenePos() const;
733 QPointF screenPos() const;
734 QPointF startScreenPos() const;
735 QPointF lastScreenPos() const;
737 QPointF normalizedPos() const;
738 QPointF startNormalizedPos() const;
739 QPointF lastNormalizedPos() const;
742 QRectF sceneRect() const;
743 QRectF screenRect() const;
745 qreal pressure() const;
746 QVector2D velocity() const;
747 InfoFlags flags() const;
748 QVector<QPointF> rawScreenPositions() const;
752 void setState(Qt::TouchPointStates state);
753 void setPos(const QPointF &pos);
754 void setScenePos(const QPointF &scenePos);
755 void setScreenPos(const QPointF &screenPos);
756 void setNormalizedPos(const QPointF &normalizedPos);
757 void setStartPos(const QPointF &startPos);
758 void setStartScenePos(const QPointF &startScenePos);
759 void setStartScreenPos(const QPointF &startScreenPos);
760 void setStartNormalizedPos(const QPointF &startNormalizedPos);
761 void setLastPos(const QPointF &lastPos);
762 void setLastScenePos(const QPointF &lastScenePos);
763 void setLastScreenPos(const QPointF &lastScreenPos);
764 void setLastNormalizedPos(const QPointF &lastNormalizedPos);
765 void setRect(const QRectF &rect);
766 void setSceneRect(const QRectF &sceneRect);
767 void setScreenRect(const QRectF &screenRect);
768 void setPressure(qreal pressure);
769 void setVelocity(const QVector2D &v);
770 void setFlags(InfoFlags flags);
771 void setRawScreenPositions(const QVector<QPointF> &positions);
774 QTouchEventTouchPointPrivate *d;
775 friend class QGuiApplication;
776 friend class QGuiApplicationPrivate;
777 friend class QApplication;
778 friend class QApplicationPrivate;
781 #if QT_DEPRECATED_SINCE(5, 0)
788 explicit QTouchEvent(QEvent::Type eventType,
789 QTouchDevice *device = 0,
790 Qt::KeyboardModifiers modifiers = Qt::NoModifier,
791 Qt::TouchPointStates touchPointStates = 0,
792 const QList<QTouchEvent::TouchPoint> &touchPoints = QList<QTouchEvent::TouchPoint>());
795 inline QWindow *window() const { return _window; }
796 inline QObject *target() const { return _target; }
797 #if QT_DEPRECATED_SINCE(5, 0)
798 QT_DEPRECATED inline QTouchEvent::DeviceType deviceType() const { return static_cast<DeviceType>(int(_device->type())); }
800 inline Qt::TouchPointStates touchPointStates() const { return _touchPointStates; }
801 inline const QList<QTouchEvent::TouchPoint> &touchPoints() const { return _touchPoints; }
802 inline QTouchDevice *device() const { return _device; }
805 inline void setWindow(QWindow *awindow) { _window = awindow; }
806 inline void setTarget(QObject *atarget) { _target = atarget; }
807 inline void setTouchPointStates(Qt::TouchPointStates aTouchPointStates) { _touchPointStates = aTouchPointStates; }
808 inline void setTouchPoints(const QList<QTouchEvent::TouchPoint> &atouchPoints) { _touchPoints = atouchPoints; }
809 inline void setDevice(QTouchDevice *adevice) { _device = adevice; }
814 QTouchDevice *_device;
815 Qt::TouchPointStates _touchPointStates;
816 QList<QTouchEvent::TouchPoint> _touchPoints;
818 friend class QGuiApplication;
819 friend class QGuiApplicationPrivate;
820 friend class QApplication;
821 friend class QApplicationPrivate;
823 Q_DECLARE_TYPEINFO(QTouchEvent::TouchPoint, Q_MOVABLE_TYPE);
824 Q_DECLARE_OPERATORS_FOR_FLAGS(QTouchEvent::TouchPoint::InfoFlags)
826 class Q_GUI_EXPORT QScrollPrepareEvent : public QEvent
829 explicit QScrollPrepareEvent(const QPointF &startPos);
830 ~QScrollPrepareEvent();
832 QPointF startPos() const;
834 QSizeF viewportSize() const;
835 QRectF contentPosRange() const;
836 QPointF contentPos() const;
838 void setViewportSize(const QSizeF &size);
839 void setContentPosRange(const QRectF &rect);
840 void setContentPos(const QPointF &pos);
845 QSizeF m_viewportSize;
846 QRectF m_contentPosRange;
847 QPointF m_contentPos;
851 class Q_GUI_EXPORT QScrollEvent : public QEvent
861 QScrollEvent(const QPointF &contentPos, const QPointF &overshoot, ScrollState scrollState);
864 QPointF contentPos() const;
865 QPointF overshootDistance() const;
866 ScrollState scrollState() const;
869 QPointF m_contentPos;
871 QScrollEvent::ScrollState m_state;
874 class Q_GUI_EXPORT QScreenOrientationChangeEvent : public QEvent
877 QScreenOrientationChangeEvent(QScreen *screen, Qt::ScreenOrientation orientation);
878 ~QScreenOrientationChangeEvent();
880 QScreen *screen() const;
881 Qt::ScreenOrientation orientation() const;
885 Qt::ScreenOrientation m_orientation;