1 /****************************************************************************
3 ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/
6 ** This file is part of the QtGui module of the Qt Toolkit.
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** GNU Lesser General Public License Usage
10 ** This file may be used under the terms of the GNU Lesser General Public
11 ** License version 2.1 as published by the Free Software Foundation and
12 ** appearing in the file LICENSE.LGPL included in the packaging of this
13 ** file. Please review the following information to ensure the GNU Lesser
14 ** General Public License version 2.1 requirements will be met:
15 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
17 ** In addition, as a special exception, Nokia gives you certain additional
18 ** rights. These rights are described in the Nokia Qt LGPL Exception
19 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
21 ** GNU General Public License Usage
22 ** Alternatively, this file may be used under the terms of the GNU General
23 ** Public License version 3.0 as published by the Free Software Foundation
24 ** and appearing in the file LICENSE.GPL included in the packaging of this
25 ** file. Please review the following information to ensure the GNU General
26 ** Public License version 3.0 requirements will be met:
27 ** http://www.gnu.org/copyleft/gpl.html.
30 ** Alternatively, this file may be used in accordance with the terms and
31 ** conditions contained in a signed written agreement between you and Nokia.
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/qfile.h>
57 #include <QtGui/qvector2d.h>
58 #include <QtGui/qtouchdevice.h>
66 #ifndef QT_NO_GESTURES
71 class Q_GUI_EXPORT QInputEvent : public QEvent
74 explicit QInputEvent(Type type, Qt::KeyboardModifiers modifiers = Qt::NoModifier);
76 inline Qt::KeyboardModifiers modifiers() const { return modState; }
77 inline void setModifiers(Qt::KeyboardModifiers amodifiers) { modState = amodifiers; }
78 inline ulong timestamp() const { return ts; }
79 inline void setTimestamp(ulong atimestamp) { ts = atimestamp; }
81 Qt::KeyboardModifiers modState;
85 class Q_GUI_EXPORT QMouseEvent : public QInputEvent
88 QMouseEvent(Type type, const QPointF &pos, Qt::MouseButton button,
89 Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers);
90 QMouseEvent(Type type, const QPointF &pos, const QPointF &globalPos,
91 Qt::MouseButton button, Qt::MouseButtons buttons,
92 Qt::KeyboardModifiers modifiers);
93 QMouseEvent(Type type, const QPointF &pos, const QPointF &windowPos, const QPointF &globalPos,
94 Qt::MouseButton button, Qt::MouseButtons buttons,
95 Qt::KeyboardModifiers modifiers);
98 #ifndef QT_NO_INTEGER_EVENT_COORDINATES
99 inline QPoint pos() const { return l.toPoint(); }
100 inline QPoint globalPos() const { return s.toPoint(); }
101 inline int x() const { return qRound(l.x()); }
102 inline int y() const { return qRound(l.y()); }
103 inline int globalX() const { return qRound(s.x()); }
104 inline int globalY() const { return qRound(s.y()); }
106 const QPointF &localPos() const { return l; }
107 const QPointF &windowPos() const { return w; }
108 const QPointF &screenPos() const { return s; }
110 inline Qt::MouseButton button() const { return b; }
111 inline Qt::MouseButtons buttons() const { return mouseState; }
113 #if QT_DEPRECATED_SINCE(5, 0)
114 QT_DEPRECATED inline QPointF posF() const { return l; }
120 Qt::MouseButtons mouseState;
123 class Q_GUI_EXPORT QHoverEvent : public QInputEvent
126 QHoverEvent(Type type, const QPointF &pos, const QPointF &oldPos, Qt::KeyboardModifiers modifiers = Qt::NoModifier);
129 #ifndef QT_NO_INTEGER_EVENT_COORDINATES
130 inline QPoint pos() const { return p.toPoint(); }
131 inline QPoint oldPos() const { return op.toPoint(); }
134 inline const QPointF &posF() const { return p; }
135 inline const QPointF &oldPosF() const { return op; }
141 #ifndef QT_NO_WHEELEVENT
142 class Q_GUI_EXPORT QWheelEvent : public QInputEvent
145 QWheelEvent(const QPointF &pos, int delta,
146 Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers,
147 Qt::Orientation orient = Qt::Vertical);
148 QWheelEvent(const QPointF &pos, const QPointF& globalPos, int delta,
149 Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers,
150 Qt::Orientation orient = Qt::Vertical);
151 QWheelEvent(const QPointF &pos, const QPointF& globalPos,
152 QPoint pixelDelta, QPoint angleDelta, int qt4Delta, Qt::Orientation qt4Orientation,
153 Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers);
158 inline QPoint pixelDelta() const { return pixelD; }
159 inline QPoint angleDelta() const { return angleD; }
161 #if QT_DEPRECATED_SINCE(5, 0)
162 inline QT_DEPRECATED int delta() const { return qt4D; }
163 inline QT_DEPRECATED Qt::Orientation orientation() const { return qt4O; }
166 #ifndef QT_NO_INTEGER_EVENT_COORDINATES
167 inline QPoint pos() const { return p.toPoint(); }
168 inline QPoint globalPos() const { return g.toPoint(); }
169 inline int x() const { return p.x(); }
170 inline int y() const { return p.y(); }
171 inline int globalX() const { return g.x(); }
172 inline int globalY() const { return g.y(); }
174 inline const QPointF &posF() const { return p; }
175 inline const QPointF &globalPosF() const { return g; }
177 inline Qt::MouseButtons buttons() const { return mouseState; }
184 Qt::Orientation qt4O;
185 Qt::MouseButtons mouseState;
190 #ifndef QT_NO_TABLETEVENT
191 class Q_GUI_EXPORT QTabletEvent : public QInputEvent
194 enum TabletDevice { NoDevice, Puck, Stylus, Airbrush, FourDMouse,
195 XFreeEraser /*internal*/, RotationStylus };
196 enum PointerType { UnknownPointer, Pen, Cursor, Eraser };
197 QTabletEvent(Type t, const QPointF &pos, const QPointF &globalPos,
198 int device, int pointerType, qreal pressure, int xTilt, int yTilt,
199 qreal tangentialPressure, qreal rotation, int z,
200 Qt::KeyboardModifiers keyState, qint64 uniqueID);
203 inline const QPoint pos() const { return mPos.toPoint(); }
204 inline const QPoint globalPos() const { return mGPos.toPoint(); }
205 #if QT_DEPRECATED_SINCE(5,0)
206 QT_DEPRECATED inline const QPointF &hiResGlobalPos() const { return mPos; }
209 inline const QPointF &posF() const { return mPos; }
210 inline const QPointF &globalPosF() const { return mGPos; }
212 inline int x() const { return qRound(mPos.x()); }
213 inline int y() const { return qRound(mPos.y()); }
214 inline int globalX() const { return qRound(mGPos.x()); }
215 inline int globalY() const { return qRound(mGPos.y()); }
216 inline qreal hiResGlobalX() const { return mGPos.x(); }
217 inline qreal hiResGlobalY() const { return mGPos.y(); }
218 inline TabletDevice device() const { return TabletDevice(mDev); }
219 inline PointerType pointerType() const { return PointerType(mPointerType); }
220 inline qint64 uniqueId() const { return mUnique; }
221 inline qreal pressure() const { return mPress; }
222 inline int z() const { return mZ; }
223 inline qreal tangentialPressure() const { return mTangential; }
224 inline qreal rotation() const { return mRot; }
225 inline int xTilt() const { return mXT; }
226 inline int yTilt() const { return mYT; }
230 int mDev, mPointerType, mXT, mYT, mZ;
231 qreal mPress, mTangential, mRot;
234 // I don't know what the future holds for tablets but there could be some
235 // new devices coming along, and there seem to be "holes" in the
236 // OS-specific events for this.
239 #endif // QT_NO_TABLETEVENT
241 class Q_GUI_EXPORT QKeyEvent : public QInputEvent
244 QKeyEvent(Type type, int key, Qt::KeyboardModifiers modifiers, const QString& text = QString(),
245 bool autorep = false, ushort count = 1);
248 int key() const { return k; }
249 #ifndef QT_NO_SHORTCUT
250 bool matches(QKeySequence::StandardKey key) const;
252 Qt::KeyboardModifiers modifiers() const;
253 inline QString text() const { return txt; }
254 inline bool isAutoRepeat() const { return autor; }
255 inline int count() const { return int(c); }
257 // Functions for the extended key event information
258 static QKeyEvent *createExtendedKeyEvent(Type type, int key, Qt::KeyboardModifiers modifiers,
259 quint32 nativeScanCode, quint32 nativeVirtualKey,
260 quint32 nativeModifiers,
261 const QString& text = QString(), bool autorep = false,
263 inline bool hasExtendedInfo() const { return reinterpret_cast<const QKeyEvent*>(d) == this; }
264 quint32 nativeScanCode() const;
265 quint32 nativeVirtualKey() const;
266 quint32 nativeModifiers() const;
276 class Q_GUI_EXPORT QFocusEvent : public QEvent
279 explicit QFocusEvent(Type type, Qt::FocusReason reason=Qt::OtherFocusReason);
282 inline bool gotFocus() const { return type() == FocusIn; }
283 inline bool lostFocus() const { return type() == FocusOut; }
285 Qt::FocusReason reason() const;
288 Qt::FocusReason m_reason;
292 class Q_GUI_EXPORT QPaintEvent : public QEvent
295 explicit QPaintEvent(const QRegion& paintRegion);
296 explicit QPaintEvent(const QRect &paintRect);
299 inline const QRect &rect() const { return m_rect; }
300 inline const QRegion ®ion() const { return m_region; }
303 friend class QApplication;
304 friend class QCoreApplication;
310 // ### Qt5: make internal
311 class Q_GUI_EXPORT QUpdateLaterEvent : public QEvent
314 explicit QUpdateLaterEvent(const QRegion& paintRegion);
315 ~QUpdateLaterEvent();
317 inline const QRegion ®ion() const { return m_region; }
323 class Q_GUI_EXPORT QMoveEvent : public QEvent
326 QMoveEvent(const QPoint &pos, const QPoint &oldPos);
329 inline const QPoint &pos() const { return p; }
330 inline const QPoint &oldPos() const { return oldp;}
333 friend class QApplication;
334 friend class QCoreApplication;
337 class Q_GUI_EXPORT QExposeEvent : public QEvent
340 explicit QExposeEvent(const QRegion &rgn);
343 inline const QRegion ®ion() const { return rgn; }
349 class Q_GUI_EXPORT QResizeEvent : public QEvent
352 QResizeEvent(const QSize &size, const QSize &oldSize);
355 inline const QSize &size() const { return s; }
356 inline const QSize &oldSize()const { return olds;}
359 friend class QApplication;
360 friend class QCoreApplication;
364 class Q_GUI_EXPORT QCloseEvent : public QEvent
372 class Q_GUI_EXPORT QIconDragEvent : public QEvent
380 class Q_GUI_EXPORT QShowEvent : public QEvent
388 class Q_GUI_EXPORT QHideEvent : public QEvent
395 #ifndef QT_NO_CONTEXTMENU
396 class Q_GUI_EXPORT QContextMenuEvent : public QInputEvent
399 enum Reason { Mouse, Keyboard, Other };
401 QContextMenuEvent(Reason reason, const QPoint &pos, const QPoint &globalPos,
402 Qt::KeyboardModifiers modifiers);
403 QContextMenuEvent(Reason reason, const QPoint &pos, const QPoint &globalPos);
404 QContextMenuEvent(Reason reason, const QPoint &pos);
405 ~QContextMenuEvent();
407 inline int x() const { return p.x(); }
408 inline int y() const { return p.y(); }
409 inline int globalX() const { return gp.x(); }
410 inline int globalY() const { return gp.y(); }
412 inline const QPoint& pos() const { return p; }
413 inline const QPoint& globalPos() const { return gp; }
415 inline Reason reason() const { return Reason(reas); }
422 #endif // QT_NO_CONTEXTMENU
424 #ifndef QT_NO_INPUTMETHOD
425 class Q_GUI_EXPORT QInputMethodEvent : public QEvent
437 Attribute(AttributeType t, int s, int l, QVariant val) : type(t), start(s), length(l), value(val) {}
445 QInputMethodEvent(const QString &preeditText, const QList<Attribute> &attributes);
446 void setCommitString(const QString &commitString, int replaceFrom = 0, int replaceLength = 0);
447 void setTentativeCommitString(const QString &tentativeCommitString);
449 inline const QList<Attribute> &attributes() const { return attrs; }
450 inline const QString &preeditString() const { return preedit; }
452 inline const QString &commitString() const { return commit; }
453 inline int replacementStart() const { return replace_from; }
454 inline int replacementLength() const { return replace_length; }
455 inline const QString &tentativeCommitString() const { return tentativeCommit; }
457 QInputMethodEvent(const QInputMethodEvent &other);
461 QList<Attribute> attrs;
465 QString tentativeCommit;
467 Q_DECLARE_TYPEINFO(QInputMethodEvent::Attribute, Q_MOVABLE_TYPE);
469 class Q_GUI_EXPORT QInputMethodQueryEvent : public QEvent
472 explicit QInputMethodQueryEvent(Qt::InputMethodQueries queries);
473 ~QInputMethodQueryEvent();
475 Qt::InputMethodQueries queries() const { return m_queries; }
477 void setValue(Qt::InputMethodQuery query, const QVariant &value);
478 QVariant value(Qt::InputMethodQuery query) const;
480 Qt::InputMethodQueries m_queries;
482 Qt::InputMethodQuery query;
485 QVector<QueryPair> m_values;
488 #endif // QT_NO_INPUTMETHOD
490 #ifndef QT_NO_DRAGANDDROP
494 class Q_GUI_EXPORT QDropEvent : public QEvent
497 QDropEvent(const QPointF& pos, Qt::DropActions actions, const QMimeData *data,
498 Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Type type = Drop);
501 inline const QPoint pos() const { return p.toPoint(); }
502 inline const QPointF &posF() const { return p; }
503 inline Qt::MouseButtons mouseButtons() const { return mouseState; }
504 inline Qt::KeyboardModifiers keyboardModifiers() const { return modState; }
506 inline Qt::DropActions possibleActions() const { return act; }
507 inline Qt::DropAction proposedAction() const { return default_action; }
508 inline void acceptProposedAction() { drop_action = default_action; accept(); }
510 inline Qt::DropAction dropAction() const { return drop_action; }
511 void setDropAction(Qt::DropAction action);
513 QObject* source() const;
514 inline const QMimeData *mimeData() const { return mdata; }
517 friend class QApplication;
519 Qt::MouseButtons mouseState;
520 Qt::KeyboardModifiers modState;
522 Qt::DropAction drop_action;
523 Qt::DropAction default_action;
524 const QMimeData *mdata;
528 class Q_GUI_EXPORT QDragMoveEvent : public QDropEvent
531 QDragMoveEvent(const QPoint &pos, Qt::DropActions actions, const QMimeData *data,
532 Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Type type = DragMove);
535 inline QRect answerRect() const { return rect; }
537 inline void accept() { QDropEvent::accept(); }
538 inline void ignore() { QDropEvent::ignore(); }
540 inline void accept(const QRect & r) { accept(); rect = r; }
541 inline void ignore(const QRect & r) { ignore(); rect = r; }
544 friend class QApplication;
549 class Q_GUI_EXPORT QDragEnterEvent : public QDragMoveEvent
552 QDragEnterEvent(const QPoint &pos, Qt::DropActions actions, const QMimeData *data,
553 Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers);
558 class Q_GUI_EXPORT QDragLeaveEvent : public QEvent
564 #endif // QT_NO_DRAGANDDROP
567 class Q_GUI_EXPORT QHelpEvent : public QEvent
570 QHelpEvent(Type type, const QPoint &pos, const QPoint &globalPos);
573 inline int x() const { return p.x(); }
574 inline int y() const { return p.y(); }
575 inline int globalX() const { return gp.x(); }
576 inline int globalY() const { return gp.y(); }
578 inline const QPoint& pos() const { return p; }
579 inline const QPoint& globalPos() const { return gp; }
586 #ifndef QT_NO_STATUSTIP
587 class Q_GUI_EXPORT QStatusTipEvent : public QEvent
590 explicit QStatusTipEvent(const QString &tip);
593 inline QString tip() const { return s; }
599 #ifndef QT_NO_WHATSTHIS
600 class Q_GUI_EXPORT QWhatsThisClickedEvent : public QEvent
603 explicit QWhatsThisClickedEvent(const QString &href);
604 ~QWhatsThisClickedEvent();
606 inline QString href() const { return s; }
613 class Q_GUI_EXPORT QActionEvent : public QEvent
617 QActionEvent(int type, QAction *action, QAction *before = 0);
620 inline QAction *action() const { return act; }
621 inline QAction *before() const { return bef; }
625 class Q_GUI_EXPORT QFileOpenEvent : public QEvent
628 explicit QFileOpenEvent(const QString &file);
629 explicit QFileOpenEvent(const QUrl &url);
632 inline QString file() const { return f; }
634 bool openFile(QFile &file, QIODevice::OpenMode flags) const;
639 #ifndef QT_NO_TOOLBAR
640 class Q_GUI_EXPORT QToolBarChangeEvent : public QEvent
643 explicit QToolBarChangeEvent(bool t);
644 ~QToolBarChangeEvent();
646 inline bool toggle() const { return tog; }
652 #ifndef QT_NO_SHORTCUT
653 class Q_GUI_EXPORT QShortcutEvent : public QEvent
656 QShortcutEvent(const QKeySequence &key, int id, bool ambiguous = false);
659 inline const QKeySequence &key() const { return sequence; }
660 inline int shortcutId() const { return sid; }
661 inline bool isAmbiguous() const { return ambig; }
663 QKeySequence sequence;
669 #ifndef QT_NO_CLIPBOARD
670 class Q_GUI_EXPORT QClipboardEvent : public QEvent
673 explicit QClipboardEvent(QEventPrivate *data);
676 QEventPrivate *data() { return d; }
680 class Q_GUI_EXPORT QWindowStateChangeEvent: public QEvent
683 explicit QWindowStateChangeEvent(Qt::WindowStates aOldState);
684 QWindowStateChangeEvent(Qt::WindowStates aOldState, bool isOverride);
685 ~QWindowStateChangeEvent();
687 inline Qt::WindowStates oldState() const { return ostate; }
688 bool isOverride() const;
691 Qt::WindowStates ostate;
694 #ifndef QT_NO_DEBUG_STREAM
695 Q_GUI_EXPORT QDebug operator<<(QDebug, const QEvent *);
698 #ifndef QT_NO_SHORTCUT
699 inline bool operator==(QKeyEvent *e, QKeySequence::StandardKey key){return (e ? e->matches(key) : false);}
700 inline bool operator==(QKeySequence::StandardKey key, QKeyEvent *e){return (e ? e->matches(key) : false);}
701 #endif // QT_NO_SHORTCUT
703 class QTouchEventTouchPointPrivate;
704 class Q_GUI_EXPORT QTouchEvent : public QInputEvent
707 class Q_GUI_EXPORT TouchPoint
713 Q_DECLARE_FLAGS(InfoFlags, InfoFlag)
715 explicit TouchPoint(int id = -1);
716 TouchPoint(const TouchPoint &other);
717 #ifdef Q_COMPILER_RVALUE_REFS
718 TouchPoint(TouchPoint &&other) : d(other.d) { other.d = 0; }
719 TouchPoint &operator=(TouchPoint &&other)
720 { qSwap(d, other.d); return *this; }
724 TouchPoint &operator=(const TouchPoint &other)
725 { if ( d != other.d ) { TouchPoint copy(other); swap(copy); } return *this; }
727 void swap(TouchPoint &other) { qSwap(d, other.d); }
731 Qt::TouchPointState state() const;
734 QPointF startPos() const;
735 QPointF lastPos() const;
737 QPointF scenePos() const;
738 QPointF startScenePos() const;
739 QPointF lastScenePos() const;
741 QPointF screenPos() const;
742 QPointF startScreenPos() const;
743 QPointF lastScreenPos() const;
745 QPointF normalizedPos() const;
746 QPointF startNormalizedPos() const;
747 QPointF lastNormalizedPos() const;
750 QRectF sceneRect() const;
751 QRectF screenRect() const;
753 qreal pressure() const;
754 QVector2D velocity() const;
755 InfoFlags flags() const;
756 QVector<QPointF> rawScreenPositions() const;
760 void setState(Qt::TouchPointStates state);
761 void setPos(const QPointF &pos);
762 void setScenePos(const QPointF &scenePos);
763 void setScreenPos(const QPointF &screenPos);
764 void setNormalizedPos(const QPointF &normalizedPos);
765 void setStartPos(const QPointF &startPos);
766 void setStartScenePos(const QPointF &startScenePos);
767 void setStartScreenPos(const QPointF &startScreenPos);
768 void setStartNormalizedPos(const QPointF &startNormalizedPos);
769 void setLastPos(const QPointF &lastPos);
770 void setLastScenePos(const QPointF &lastScenePos);
771 void setLastScreenPos(const QPointF &lastScreenPos);
772 void setLastNormalizedPos(const QPointF &lastNormalizedPos);
773 void setRect(const QRectF &rect);
774 void setSceneRect(const QRectF &sceneRect);
775 void setScreenRect(const QRectF &screenRect);
776 void setPressure(qreal pressure);
777 void setVelocity(const QVector2D &v);
778 void setFlags(InfoFlags flags);
779 void setRawScreenPositions(const QVector<QPointF> &positions);
782 QTouchEventTouchPointPrivate *d;
783 friend class QGuiApplication;
784 friend class QGuiApplicationPrivate;
785 friend class QApplication;
786 friend class QApplicationPrivate;
789 #if QT_DEPRECATED_SINCE(5, 0)
790 QT_DEPRECATED enum DeviceType {
796 explicit QTouchEvent(QEvent::Type eventType,
797 QTouchDevice *device = 0,
798 Qt::KeyboardModifiers modifiers = Qt::NoModifier,
799 Qt::TouchPointStates touchPointStates = 0,
800 const QList<QTouchEvent::TouchPoint> &touchPoints = QList<QTouchEvent::TouchPoint>());
803 inline QWindow *window() const { return _window; }
804 inline QObject *target() const { return _target; }
805 #if QT_DEPRECATED_SINCE(5, 0)
806 QT_DEPRECATED inline QTouchEvent::DeviceType deviceType() const { return static_cast<DeviceType>(int(_device->type())); }
808 inline Qt::TouchPointStates touchPointStates() const { return _touchPointStates; }
809 inline const QList<QTouchEvent::TouchPoint> &touchPoints() const { return _touchPoints; }
810 inline QTouchDevice *device() const { return _device; }
813 inline void setWindow(QWindow *awindow) { _window = awindow; }
814 inline void setTarget(QObject *atarget) { _target = atarget; }
815 inline void setTouchPointStates(Qt::TouchPointStates aTouchPointStates) { _touchPointStates = aTouchPointStates; }
816 inline void setTouchPoints(const QList<QTouchEvent::TouchPoint> &atouchPoints) { _touchPoints = atouchPoints; }
817 inline void setDevice(QTouchDevice *adevice) { _device = adevice; }
822 QTouchDevice *_device;
823 Qt::TouchPointStates _touchPointStates;
824 QList<QTouchEvent::TouchPoint> _touchPoints;
826 friend class QGuiApplication;
827 friend class QGuiApplicationPrivate;
828 friend class QApplication;
829 friend class QApplicationPrivate;
831 Q_DECLARE_TYPEINFO(QTouchEvent::TouchPoint, Q_MOVABLE_TYPE);
832 Q_DECLARE_OPERATORS_FOR_FLAGS(QTouchEvent::TouchPoint::InfoFlags)
834 class QScrollPrepareEventPrivate;
835 class Q_GUI_EXPORT QScrollPrepareEvent : public QEvent
838 explicit QScrollPrepareEvent(const QPointF &startPos);
839 ~QScrollPrepareEvent();
841 QPointF startPos() const;
843 QSizeF viewportSize() const;
844 QRectF contentPosRange() const;
845 QPointF contentPos() const;
847 void setViewportSize(const QSizeF &size);
848 void setContentPosRange(const QRectF &rect);
849 void setContentPos(const QPointF &pos);
852 QScrollPrepareEventPrivate *d_func();
853 const QScrollPrepareEventPrivate *d_func() const;
857 class QScrollEventPrivate;
858 class Q_GUI_EXPORT QScrollEvent : public QEvent
868 QScrollEvent(const QPointF &contentPos, const QPointF &overshoot, ScrollState scrollState);
871 QPointF contentPos() const;
872 QPointF overshootDistance() const;
873 ScrollState scrollState() const;
876 QScrollEventPrivate *d_func();
877 const QScrollEventPrivate *d_func() const;
880 class QScreenOrientationChangeEventPrivate;
881 class Q_GUI_EXPORT QScreenOrientationChangeEvent : public QEvent
884 QScreenOrientationChangeEvent(QScreen *screen, Qt::ScreenOrientation orientation);
885 ~QScreenOrientationChangeEvent();
887 QScreen *screen() const;
888 Qt::ScreenOrientation orientation() const;
891 QScreenOrientationChangeEventPrivate *d_func();
892 const QScreenOrientationChangeEventPrivate *d_func() const;