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);
246 QKeyEvent(Type type, int key, Qt::KeyboardModifiers modifiers,
247 quint32 nativeScanCode, quint32 nativeVirtualKey, quint32 nativeModifiers,
248 const QString &text = QString(), bool autorep = false, ushort count = 1);
251 int key() const { return k; }
252 #ifndef QT_NO_SHORTCUT
253 bool matches(QKeySequence::StandardKey key) const;
255 Qt::KeyboardModifiers modifiers() const;
256 inline QString text() const { return txt; }
257 inline bool isAutoRepeat() const { return autor; }
258 inline int count() const { return int(c); }
260 inline quint32 nativeScanCode() const { return nScanCode; }
261 inline quint32 nativeVirtualKey() const { return nVirtualKey; }
262 inline quint32 nativeModifiers() const { return nModifiers; }
264 // Functions for the extended key event information
265 #if QT_DEPRECATED_SINCE(5, 0)
266 static inline QKeyEvent *createExtendedKeyEvent(Type type, int key, Qt::KeyboardModifiers modifiers,
267 quint32 nativeScanCode, quint32 nativeVirtualKey,
268 quint32 nativeModifiers,
269 const QString& text = QString(), bool autorep = false,
272 return new QKeyEvent(type, key, modifiers,
273 nativeScanCode, nativeVirtualKey, nativeModifiers,
274 text, autorep, count);
277 inline bool hasExtendedInfo() const { return true; }
288 // ushort reserved:15;
292 class Q_GUI_EXPORT QFocusEvent : public QEvent
295 explicit QFocusEvent(Type type, Qt::FocusReason reason=Qt::OtherFocusReason);
298 inline bool gotFocus() const { return type() == FocusIn; }
299 inline bool lostFocus() const { return type() == FocusOut; }
301 Qt::FocusReason reason() const;
304 Qt::FocusReason m_reason;
308 class Q_GUI_EXPORT QPaintEvent : public QEvent
311 explicit QPaintEvent(const QRegion& paintRegion);
312 explicit QPaintEvent(const QRect &paintRect);
315 inline const QRect &rect() const { return m_rect; }
316 inline const QRegion ®ion() const { return m_region; }
319 friend class QApplication;
320 friend class QCoreApplication;
326 // ### Qt5: make internal
327 class Q_GUI_EXPORT QUpdateLaterEvent : public QEvent
330 explicit QUpdateLaterEvent(const QRegion& paintRegion);
331 ~QUpdateLaterEvent();
333 inline const QRegion ®ion() const { return m_region; }
339 class Q_GUI_EXPORT QMoveEvent : public QEvent
342 QMoveEvent(const QPoint &pos, const QPoint &oldPos);
345 inline const QPoint &pos() const { return p; }
346 inline const QPoint &oldPos() const { return oldp;}
349 friend class QApplication;
350 friend class QCoreApplication;
353 class Q_GUI_EXPORT QExposeEvent : public QEvent
356 explicit QExposeEvent(const QRegion &rgn);
359 inline const QRegion ®ion() const { return rgn; }
365 class Q_GUI_EXPORT QResizeEvent : public QEvent
368 QResizeEvent(const QSize &size, const QSize &oldSize);
371 inline const QSize &size() const { return s; }
372 inline const QSize &oldSize()const { return olds;}
375 friend class QApplication;
376 friend class QCoreApplication;
380 class Q_GUI_EXPORT QCloseEvent : public QEvent
388 class Q_GUI_EXPORT QIconDragEvent : public QEvent
396 class Q_GUI_EXPORT QShowEvent : public QEvent
404 class Q_GUI_EXPORT QHideEvent : public QEvent
411 #ifndef QT_NO_CONTEXTMENU
412 class Q_GUI_EXPORT QContextMenuEvent : public QInputEvent
415 enum Reason { Mouse, Keyboard, Other };
417 QContextMenuEvent(Reason reason, const QPoint &pos, const QPoint &globalPos,
418 Qt::KeyboardModifiers modifiers);
419 QContextMenuEvent(Reason reason, const QPoint &pos, const QPoint &globalPos);
420 QContextMenuEvent(Reason reason, const QPoint &pos);
421 ~QContextMenuEvent();
423 inline int x() const { return p.x(); }
424 inline int y() const { return p.y(); }
425 inline int globalX() const { return gp.x(); }
426 inline int globalY() const { return gp.y(); }
428 inline const QPoint& pos() const { return p; }
429 inline const QPoint& globalPos() const { return gp; }
431 inline Reason reason() const { return Reason(reas); }
438 #endif // QT_NO_CONTEXTMENU
440 #ifndef QT_NO_INPUTMETHOD
441 class Q_GUI_EXPORT QInputMethodEvent : public QEvent
453 Attribute(AttributeType t, int s, int l, QVariant val) : type(t), start(s), length(l), value(val) {}
461 QInputMethodEvent(const QString &preeditText, const QList<Attribute> &attributes);
462 void setCommitString(const QString &commitString, int replaceFrom = 0, int replaceLength = 0);
463 QT_DEPRECATED void setTentativeCommitString(const QString &tentativeCommitString);
465 inline const QList<Attribute> &attributes() const { return attrs; }
466 inline const QString &preeditString() const { return preedit; }
468 inline const QString &commitString() const { return commit; }
469 inline int replacementStart() const { return replace_from; }
470 inline int replacementLength() const { return replace_length; }
471 QT_DEPRECATED inline const QString &tentativeCommitString() const { return tentativeCommit; }
473 QInputMethodEvent(const QInputMethodEvent &other);
477 QList<Attribute> attrs;
481 QString tentativeCommit;
483 Q_DECLARE_TYPEINFO(QInputMethodEvent::Attribute, Q_MOVABLE_TYPE);
485 class Q_GUI_EXPORT QInputMethodQueryEvent : public QEvent
488 explicit QInputMethodQueryEvent(Qt::InputMethodQueries queries);
489 ~QInputMethodQueryEvent();
491 Qt::InputMethodQueries queries() const { return m_queries; }
493 void setValue(Qt::InputMethodQuery query, const QVariant &value);
494 QVariant value(Qt::InputMethodQuery query) const;
496 Qt::InputMethodQueries m_queries;
498 Qt::InputMethodQuery query;
501 QVector<QueryPair> m_values;
504 #endif // QT_NO_INPUTMETHOD
506 #ifndef QT_NO_DRAGANDDROP
510 class Q_GUI_EXPORT QDropEvent : public QEvent
513 QDropEvent(const QPointF& pos, Qt::DropActions actions, const QMimeData *data,
514 Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Type type = Drop);
517 inline const QPoint pos() const { return p.toPoint(); }
518 inline const QPointF &posF() const { return p; }
519 inline Qt::MouseButtons mouseButtons() const { return mouseState; }
520 inline Qt::KeyboardModifiers keyboardModifiers() const { return modState; }
522 inline Qt::DropActions possibleActions() const { return act; }
523 inline Qt::DropAction proposedAction() const { return default_action; }
524 inline void acceptProposedAction() { drop_action = default_action; accept(); }
526 inline Qt::DropAction dropAction() const { return drop_action; }
527 void setDropAction(Qt::DropAction action);
529 QObject* source() const;
530 inline const QMimeData *mimeData() const { return mdata; }
533 friend class QApplication;
535 Qt::MouseButtons mouseState;
536 Qt::KeyboardModifiers modState;
538 Qt::DropAction drop_action;
539 Qt::DropAction default_action;
540 const QMimeData *mdata;
544 class Q_GUI_EXPORT QDragMoveEvent : public QDropEvent
547 QDragMoveEvent(const QPoint &pos, Qt::DropActions actions, const QMimeData *data,
548 Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Type type = DragMove);
551 inline QRect answerRect() const { return rect; }
553 inline void accept() { QDropEvent::accept(); }
554 inline void ignore() { QDropEvent::ignore(); }
556 inline void accept(const QRect & r) { accept(); rect = r; }
557 inline void ignore(const QRect & r) { ignore(); rect = r; }
560 friend class QApplication;
565 class Q_GUI_EXPORT QDragEnterEvent : public QDragMoveEvent
568 QDragEnterEvent(const QPoint &pos, Qt::DropActions actions, const QMimeData *data,
569 Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers);
574 class Q_GUI_EXPORT QDragLeaveEvent : public QEvent
580 #endif // QT_NO_DRAGANDDROP
583 class Q_GUI_EXPORT QHelpEvent : public QEvent
586 QHelpEvent(Type type, const QPoint &pos, const QPoint &globalPos);
589 inline int x() const { return p.x(); }
590 inline int y() const { return p.y(); }
591 inline int globalX() const { return gp.x(); }
592 inline int globalY() const { return gp.y(); }
594 inline const QPoint& pos() const { return p; }
595 inline const QPoint& globalPos() const { return gp; }
602 #ifndef QT_NO_STATUSTIP
603 class Q_GUI_EXPORT QStatusTipEvent : public QEvent
606 explicit QStatusTipEvent(const QString &tip);
609 inline QString tip() const { return s; }
615 #ifndef QT_NO_WHATSTHIS
616 class Q_GUI_EXPORT QWhatsThisClickedEvent : public QEvent
619 explicit QWhatsThisClickedEvent(const QString &href);
620 ~QWhatsThisClickedEvent();
622 inline QString href() const { return s; }
629 class Q_GUI_EXPORT QActionEvent : public QEvent
633 QActionEvent(int type, QAction *action, QAction *before = 0);
636 inline QAction *action() const { return act; }
637 inline QAction *before() const { return bef; }
641 class Q_GUI_EXPORT QFileOpenEvent : public QEvent
644 explicit QFileOpenEvent(const QString &file);
645 explicit QFileOpenEvent(const QUrl &url);
648 inline QString file() const { return f; }
650 bool openFile(QFile &file, QIODevice::OpenMode flags) const;
655 #ifndef QT_NO_TOOLBAR
656 class Q_GUI_EXPORT QToolBarChangeEvent : public QEvent
659 explicit QToolBarChangeEvent(bool t);
660 ~QToolBarChangeEvent();
662 inline bool toggle() const { return tog; }
668 #ifndef QT_NO_SHORTCUT
669 class Q_GUI_EXPORT QShortcutEvent : public QEvent
672 QShortcutEvent(const QKeySequence &key, int id, bool ambiguous = false);
675 inline const QKeySequence &key() const { return sequence; }
676 inline int shortcutId() const { return sid; }
677 inline bool isAmbiguous() const { return ambig; }
679 QKeySequence sequence;
685 #ifndef QT_NO_CLIPBOARD
686 class Q_GUI_EXPORT QClipboardEvent : public QEvent
689 explicit QClipboardEvent(QEventPrivate *data);
692 QEventPrivate *data() { return d; }
696 class Q_GUI_EXPORT QWindowStateChangeEvent: public QEvent
699 explicit QWindowStateChangeEvent(Qt::WindowStates aOldState);
700 QWindowStateChangeEvent(Qt::WindowStates aOldState, bool isOverride);
701 ~QWindowStateChangeEvent();
703 inline Qt::WindowStates oldState() const { return ostate; }
704 bool isOverride() const;
707 Qt::WindowStates ostate;
710 #ifndef QT_NO_DEBUG_STREAM
711 Q_GUI_EXPORT QDebug operator<<(QDebug, const QEvent *);
714 #ifndef QT_NO_SHORTCUT
715 inline bool operator==(QKeyEvent *e, QKeySequence::StandardKey key){return (e ? e->matches(key) : false);}
716 inline bool operator==(QKeySequence::StandardKey key, QKeyEvent *e){return (e ? e->matches(key) : false);}
717 #endif // QT_NO_SHORTCUT
719 class QTouchEventTouchPointPrivate;
720 class Q_GUI_EXPORT QTouchEvent : public QInputEvent
723 class Q_GUI_EXPORT TouchPoint
729 Q_DECLARE_FLAGS(InfoFlags, InfoFlag)
731 explicit TouchPoint(int id = -1);
732 TouchPoint(const TouchPoint &other);
733 #ifdef Q_COMPILER_RVALUE_REFS
734 TouchPoint(TouchPoint &&other) : d(other.d) { other.d = 0; }
735 TouchPoint &operator=(TouchPoint &&other)
736 { qSwap(d, other.d); return *this; }
740 TouchPoint &operator=(const TouchPoint &other)
741 { if ( d != other.d ) { TouchPoint copy(other); swap(copy); } return *this; }
743 void swap(TouchPoint &other) { qSwap(d, other.d); }
747 Qt::TouchPointState state() const;
750 QPointF startPos() const;
751 QPointF lastPos() const;
753 QPointF scenePos() const;
754 QPointF startScenePos() const;
755 QPointF lastScenePos() const;
757 QPointF screenPos() const;
758 QPointF startScreenPos() const;
759 QPointF lastScreenPos() const;
761 QPointF normalizedPos() const;
762 QPointF startNormalizedPos() const;
763 QPointF lastNormalizedPos() const;
766 QRectF sceneRect() const;
767 QRectF screenRect() const;
769 qreal pressure() const;
770 QVector2D velocity() const;
771 InfoFlags flags() const;
772 QVector<QPointF> rawScreenPositions() const;
776 void setState(Qt::TouchPointStates state);
777 void setPos(const QPointF &pos);
778 void setScenePos(const QPointF &scenePos);
779 void setScreenPos(const QPointF &screenPos);
780 void setNormalizedPos(const QPointF &normalizedPos);
781 void setStartPos(const QPointF &startPos);
782 void setStartScenePos(const QPointF &startScenePos);
783 void setStartScreenPos(const QPointF &startScreenPos);
784 void setStartNormalizedPos(const QPointF &startNormalizedPos);
785 void setLastPos(const QPointF &lastPos);
786 void setLastScenePos(const QPointF &lastScenePos);
787 void setLastScreenPos(const QPointF &lastScreenPos);
788 void setLastNormalizedPos(const QPointF &lastNormalizedPos);
789 void setRect(const QRectF &rect);
790 void setSceneRect(const QRectF &sceneRect);
791 void setScreenRect(const QRectF &screenRect);
792 void setPressure(qreal pressure);
793 void setVelocity(const QVector2D &v);
794 void setFlags(InfoFlags flags);
795 void setRawScreenPositions(const QVector<QPointF> &positions);
798 QTouchEventTouchPointPrivate *d;
799 friend class QGuiApplication;
800 friend class QGuiApplicationPrivate;
801 friend class QApplication;
802 friend class QApplicationPrivate;
805 #if QT_DEPRECATED_SINCE(5, 0)
806 QT_DEPRECATED enum DeviceType {
812 explicit QTouchEvent(QEvent::Type eventType,
813 QTouchDevice *device = 0,
814 Qt::KeyboardModifiers modifiers = Qt::NoModifier,
815 Qt::TouchPointStates touchPointStates = 0,
816 const QList<QTouchEvent::TouchPoint> &touchPoints = QList<QTouchEvent::TouchPoint>());
819 inline QWindow *window() const { return _window; }
820 inline QObject *target() const { return _target; }
821 #if QT_DEPRECATED_SINCE(5, 0)
822 QT_DEPRECATED inline QTouchEvent::DeviceType deviceType() const { return static_cast<DeviceType>(int(_device->type())); }
824 inline Qt::TouchPointStates touchPointStates() const { return _touchPointStates; }
825 inline const QList<QTouchEvent::TouchPoint> &touchPoints() const { return _touchPoints; }
826 inline QTouchDevice *device() const { return _device; }
829 inline void setWindow(QWindow *awindow) { _window = awindow; }
830 inline void setTarget(QObject *atarget) { _target = atarget; }
831 inline void setTouchPointStates(Qt::TouchPointStates aTouchPointStates) { _touchPointStates = aTouchPointStates; }
832 inline void setTouchPoints(const QList<QTouchEvent::TouchPoint> &atouchPoints) { _touchPoints = atouchPoints; }
833 inline void setDevice(QTouchDevice *adevice) { _device = adevice; }
838 QTouchDevice *_device;
839 Qt::TouchPointStates _touchPointStates;
840 QList<QTouchEvent::TouchPoint> _touchPoints;
842 friend class QGuiApplication;
843 friend class QGuiApplicationPrivate;
844 friend class QApplication;
845 friend class QApplicationPrivate;
847 Q_DECLARE_TYPEINFO(QTouchEvent::TouchPoint, Q_MOVABLE_TYPE);
848 Q_DECLARE_OPERATORS_FOR_FLAGS(QTouchEvent::TouchPoint::InfoFlags)
850 class QScrollPrepareEventPrivate;
851 class Q_GUI_EXPORT QScrollPrepareEvent : public QEvent
854 explicit QScrollPrepareEvent(const QPointF &startPos);
855 ~QScrollPrepareEvent();
857 QPointF startPos() const;
859 QSizeF viewportSize() const;
860 QRectF contentPosRange() const;
861 QPointF contentPos() const;
863 void setViewportSize(const QSizeF &size);
864 void setContentPosRange(const QRectF &rect);
865 void setContentPos(const QPointF &pos);
868 QScrollPrepareEventPrivate *d_func();
869 const QScrollPrepareEventPrivate *d_func() const;
873 class QScrollEventPrivate;
874 class Q_GUI_EXPORT QScrollEvent : public QEvent
884 QScrollEvent(const QPointF &contentPos, const QPointF &overshoot, ScrollState scrollState);
887 QPointF contentPos() const;
888 QPointF overshootDistance() const;
889 ScrollState scrollState() const;
892 QScrollEventPrivate *d_func();
893 const QScrollEventPrivate *d_func() const;
896 class QScreenOrientationChangeEventPrivate;
897 class Q_GUI_EXPORT QScreenOrientationChangeEvent : public QEvent
900 QScreenOrientationChangeEvent(QScreen *screen, Qt::ScreenOrientation orientation);
901 ~QScreenOrientationChangeEvent();
903 QScreen *screen() const;
904 Qt::ScreenOrientation orientation() const;
907 QScreenOrientationChangeEventPrivate *d_func();
908 const QScreenOrientationChangeEventPrivate *d_func() const;