Qt 4.8
qevent.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtGui module of the Qt Toolkit.
7 **
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.
16 **
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.
24 **
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.
28 **
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.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #ifndef QEVENT_H
43 #define QEVENT_H
44 
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 <QtGui/qmime.h>
53 #include <QtGui/qdrag.h>
54 #include <QtCore/qvariant.h>
55 #include <QtCore/qmap.h>
56 #include <QtCore/qset.h>
57 #include <QtCore/qfile.h>
58 
59 #ifdef Q_OS_SYMBIAN
60 class RFile;
61 #endif
62 
64 
66 
67 QT_MODULE(Gui)
68 
69 class QAction;
70 #ifndef QT_NO_GESTURES
71 class QGesture;
72 #endif
73 
75 {
76 public:
77  QInputEvent(Type type, Qt::KeyboardModifiers modifiers = Qt::NoModifier);
78  ~QInputEvent();
79  inline Qt::KeyboardModifiers modifiers() const { return modState; }
80  inline void setModifiers(Qt::KeyboardModifiers amodifiers) { modState = amodifiers; }
81 protected:
82  Qt::KeyboardModifiers modState;
83 };
84 
86 {
87 public:
88  QMouseEvent(Type type, const QPoint &pos, Qt::MouseButton button,
89  Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers);
90  QMouseEvent(Type type, const QPoint &pos, const QPoint &globalPos,
91  Qt::MouseButton button, Qt::MouseButtons buttons,
92  Qt::KeyboardModifiers modifiers);
93  ~QMouseEvent();
94 
95  inline const QPoint &pos() const { return p; }
96  inline const QPoint &globalPos() const { return g; }
97  inline int x() const { return p.x(); }
98  inline int y() const { return p.y(); }
99  inline int globalX() const { return g.x(); }
100  inline int globalY() const { return g.y(); }
101  inline Qt::MouseButton button() const { return b; }
102  inline Qt::MouseButtons buttons() const { return mouseState; }
103 
104  static QMouseEvent *createExtendedMouseEvent(Type type, const QPointF &pos,
105  const QPoint &globalPos, Qt::MouseButton button,
106  Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers);
107  inline bool hasExtendedInfo() const { return reinterpret_cast<const QMouseEvent *>(d) == this; }
108  QPointF posF() const;
109 
110 #ifdef QT3_SUPPORT
111  QT3_SUPPORT_CONSTRUCTOR QMouseEvent(Type type, const QPoint &pos, Qt::ButtonState button, int state);
112  QT3_SUPPORT_CONSTRUCTOR QMouseEvent(Type type, const QPoint &pos, const QPoint &globalPos,
113  Qt::ButtonState button, int state);
114  inline QT3_SUPPORT Qt::ButtonState state() const
115  { return Qt::ButtonState((mouseState^b)|int(modifiers())); }
116  inline QT3_SUPPORT Qt::ButtonState stateAfter() const
117  { return Qt::ButtonState(int(mouseState)|int(modifiers())); }
118 #endif
119 protected:
120  QPoint p, g;
122  Qt::MouseButtons mouseState;
123 };
124 
126 {
127 public:
128  QHoverEvent(Type type, const QPoint &pos, const QPoint &oldPos);
129  ~QHoverEvent();
130 
131  inline const QPoint &pos() const { return p; }
132  inline const QPoint &oldPos() const { return op; }
133 
134 protected:
135  QPoint p, op;
136 };
137 
138 #ifndef QT_NO_WHEELEVENT
140 {
141 public:
142  QWheelEvent(const QPoint &pos, int delta,
143  Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers,
144  Qt::Orientation orient = Qt::Vertical);
145  QWheelEvent(const QPoint &pos, const QPoint& globalPos, int delta,
146  Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers,
147  Qt::Orientation orient = Qt::Vertical);
148  ~QWheelEvent();
149 
150  inline int delta() const { return d; }
151  inline const QPoint &pos() const { return p; }
152  inline const QPoint &globalPos() const { return g; }
153  inline int x() const { return p.x(); }
154  inline int y() const { return p.y(); }
155  inline int globalX() const { return g.x(); }
156  inline int globalY() const { return g.y(); }
157 
158  inline Qt::MouseButtons buttons() const { return mouseState; }
159  Qt::Orientation orientation() const { return o; }
160 
161 #ifdef QT3_SUPPORT
162  QT3_SUPPORT_CONSTRUCTOR QWheelEvent(const QPoint &pos, int delta, int state,
163  Qt::Orientation orient = Qt::Vertical);
164  QT3_SUPPORT_CONSTRUCTOR QWheelEvent(const QPoint &pos, const QPoint& globalPos, int delta, int state,
165  Qt::Orientation orient = Qt::Vertical);
166  inline QT3_SUPPORT Qt::ButtonState state() const
167  { return static_cast<Qt::ButtonState>(int(buttons())|int(modifiers())); }
168 #endif
169 protected:
172  int d;
173  Qt::MouseButtons mouseState;
175 };
176 #endif
177 
178 #ifndef QT_NO_TABLETEVENT
180 {
181 public:
182  enum TabletDevice { NoDevice, Puck, Stylus, Airbrush, FourDMouse,
183  XFreeEraser /*internal*/, RotationStylus };
184  enum PointerType { UnknownPointer, Pen, Cursor, Eraser };
185  QTabletEvent(Type t, const QPoint &pos, const QPoint &globalPos, const QPointF &hiResGlobalPos,
186  int device, int pointerType, qreal pressure, int xTilt, int yTilt,
187  qreal tangentialPressure, qreal rotation, int z,
188  Qt::KeyboardModifiers keyState, qint64 uniqueID);
189  ~QTabletEvent();
190 
191  inline const QPoint &pos() const { return mPos; }
192  inline const QPoint &globalPos() const { return mGPos; }
193  inline const QPointF &hiResGlobalPos() const { return mHiResGlobalPos; }
194  inline int x() const { return mPos.x(); }
195  inline int y() const { return mPos.y(); }
196  inline int globalX() const { return mGPos.x(); }
197  inline int globalY() const { return mGPos.y(); }
198  inline qreal hiResGlobalX() const { return mHiResGlobalPos.x(); }
199  inline qreal hiResGlobalY() const { return mHiResGlobalPos.y(); }
200  inline TabletDevice device() const { return TabletDevice(mDev); }
201  inline PointerType pointerType() const { return PointerType(mPointerType); }
202  inline qint64 uniqueId() const { return mUnique; }
203  inline qreal pressure() const { return mPress; }
204  inline int z() const { return mZ; }
205  inline qreal tangentialPressure() const { return mTangential; }
206  inline qreal rotation() const { return mRot; }
207  inline int xTilt() const { return mXT; }
208  inline int yTilt() const { return mYT; }
209 
210 protected:
211  QPoint mPos, mGPos;
213  int mDev, mPointerType, mXT, mYT, mZ;
214  qreal mPress, mTangential, mRot;
216 
217  // I don't know what the future holds for tablets but there could be some
218  // new devices coming along, and there seem to be "holes" in the
219  // OS-specific events for this.
220  void *mExtra;
221 };
222 #endif // QT_NO_TABLETEVENT
223 
225 {
226 public:
227  QKeyEvent(Type type, int key, Qt::KeyboardModifiers modifiers, const QString& text = QString(),
228  bool autorep = false, ushort count = 1);
229  ~QKeyEvent();
230 
231  int key() const { return k; }
232 #ifndef QT_NO_SHORTCUT
233  bool matches(QKeySequence::StandardKey key) const;
234 #endif
235  Qt::KeyboardModifiers modifiers() const;
236  inline QString text() const { return txt; }
237  inline bool isAutoRepeat() const { return autor; }
238  inline int count() const { return int(c); }
239 
240  // Functions for the extended key event information
241  static QKeyEvent *createExtendedKeyEvent(Type type, int key, Qt::KeyboardModifiers modifiers,
242  quint32 nativeScanCode, quint32 nativeVirtualKey,
243  quint32 nativeModifiers,
244  const QString& text = QString(), bool autorep = false,
245  ushort count = 1);
246  inline bool hasExtendedInfo() const { return reinterpret_cast<const QKeyEvent*>(d) == this; }
247  quint32 nativeScanCode() const;
248  quint32 nativeVirtualKey() const;
249  quint32 nativeModifiers() const;
250 
251 #ifdef QT3_SUPPORT
252  inline QT3_SUPPORT_CONSTRUCTOR QKeyEvent(Type type, int key, int /*ascii*/,
253  int modifiers, const QString& text = QString(),
254  bool autorep = false, ushort count = 1)
255  : QInputEvent(type, Qt::KeyboardModifiers(modifiers & (int)Qt::KeyButtonMask)), txt(text), k(key),
256  c(count), autor(autorep)
257  {
258  if (key >= Qt::Key_Back && key <= Qt::Key_MediaLast)
259  ignore();
260  }
261  inline QT3_SUPPORT int ascii() const
262  { return (txt.length() ? txt.unicode()->toLatin1() : 0); }
263  inline QT3_SUPPORT Qt::ButtonState state() const { return Qt::ButtonState(QInputEvent::modifiers()); }
264  inline QT3_SUPPORT Qt::ButtonState stateAfter() const { return Qt::ButtonState(modifiers()); }
265 #endif
266 
267 protected:
269  int k;
272 };
273 
274 
276 {
277 public:
279  ~QFocusEvent();
280 
281  inline bool gotFocus() const { return type() == FocusIn; }
282  inline bool lostFocus() const { return type() == FocusOut; }
283 
284 #ifdef QT3_SUPPORT
285  enum Reason { Mouse=Qt::MouseFocusReason, Tab=Qt::TabFocusReason,
289 #endif
290  Qt::FocusReason reason();
291  Qt::FocusReason reason() const;
292 
293 private:
295 };
296 
297 
299 {
300 public:
301  QPaintEvent(const QRegion& paintRegion);
302  QPaintEvent(const QRect &paintRect);
303  ~QPaintEvent();
304 
305  inline const QRect &rect() const { return m_rect; }
306  inline const QRegion &region() const { return m_region; }
307 
308 #ifdef QT3_SUPPORT
309  QT3_SUPPORT_CONSTRUCTOR QPaintEvent(const QRegion &paintRegion, const QRect &paintRect);
310  inline QT3_SUPPORT bool erased() const { return m_erased; }
311  inline QT3_SUPPORT void setErased(bool b) { m_erased = b; }
312 #endif
313 
314 protected:
315  friend class QApplication;
316  friend class QCoreApplication;
319  bool m_erased;
320 };
321 
322 class QUpdateLaterEvent : public QEvent
323 {
324 public:
325  QUpdateLaterEvent(const QRegion& paintRegion);
327 
328  inline const QRegion &region() const { return m_region; }
329 
330 protected:
332 };
333 
335 {
336 public:
337  QMoveEvent(const QPoint &pos, const QPoint &oldPos);
338  ~QMoveEvent();
339 
340  inline const QPoint &pos() const { return p; }
341  inline const QPoint &oldPos() const { return oldp;}
342 protected:
343  QPoint p, oldp;
344  friend class QApplication;
345  friend class QCoreApplication;
346 };
347 
348 
350 {
351 public:
352  QResizeEvent(const QSize &size, const QSize &oldSize);
353  ~QResizeEvent();
354 
355  inline const QSize &size() const { return s; }
356  inline const QSize &oldSize()const { return olds;}
357 protected:
358  QSize s, olds;
359  friend class QApplication;
360  friend class QCoreApplication;
361 };
362 
363 
365 {
366 public:
367  QCloseEvent();
368  ~QCloseEvent();
369 };
370 
371 
373 {
374 public:
375  QIconDragEvent();
376  ~QIconDragEvent();
377 };
378 
379 
381 {
382 public:
383  QShowEvent();
384  ~QShowEvent();
385 };
386 
387 
389 {
390 public:
391  QHideEvent();
392  ~QHideEvent();
393 };
394 
395 #ifndef QT_NO_CONTEXTMENU
397 {
398 public:
399  enum Reason { Mouse, Keyboard, Other };
400 
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);
406 
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(); }
411 
412  inline const QPoint& pos() const { return p; }
413  inline const QPoint& globalPos() const { return gp; }
414 
415  inline Reason reason() const { return Reason(reas); }
416 
417 #ifdef QT3_SUPPORT
418  QT3_SUPPORT_CONSTRUCTOR QContextMenuEvent(Reason reason, const QPoint &pos, const QPoint &globalPos, int);
419  QT3_SUPPORT_CONSTRUCTOR QContextMenuEvent(Reason reason, const QPoint &pos, int);
420 
421  QT3_SUPPORT Qt::ButtonState state() const;
422 #endif
423 protected:
426  uint reas : 8;
427 };
428 #endif // QT_NO_CONTEXTMENU
429 
430 #ifndef QT_NO_INPUTMETHOD
432 {
433 public:
439  Selection
440  };
441  class Attribute {
442  public:
443  Attribute(AttributeType t, int s, int l, QVariant val) : type(t), start(s), length(l), value(val) {}
445 
446  int start;
447  int length;
449  };
451  QInputMethodEvent(const QString &preeditText, const QList<Attribute> &attributes);
452  void setCommitString(const QString &commitString, int replaceFrom = 0, int replaceLength = 0);
453 
454  inline const QList<Attribute> &attributes() const { return attrs; }
455  inline const QString &preeditString() const { return preedit; }
456 
457  inline const QString &commitString() const { return commit; }
458  inline int replacementStart() const { return replace_from; }
459  inline int replacementLength() const { return replace_length; }
460 
461  QInputMethodEvent(const QInputMethodEvent &other);
462 
463 private:
469 };
470 #endif // QT_NO_INPUTMETHOD
471 
472 #ifndef QT_NO_DRAGANDDROP
473 
474 class QMimeData;
475 
477 // QT3_SUPPORT
478  , public QMimeSource
479 // END QT3_SUPPORT
480 {
481 public:
482  QDropEvent(const QPoint& pos, Qt::DropActions actions, const QMimeData *data,
483  Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Type type = Drop);
484  ~QDropEvent();
485 
486  inline const QPoint &pos() const { return p; }
487  inline Qt::MouseButtons mouseButtons() const { return mouseState; }
488  inline Qt::KeyboardModifiers keyboardModifiers() const { return modState; }
489 
490  inline Qt::DropActions possibleActions() const { return act; }
491  inline Qt::DropAction proposedAction() const { return default_action; }
492  inline void acceptProposedAction() { drop_action = default_action; accept(); }
493 
494  inline Qt::DropAction dropAction() const { return drop_action; }
495  void setDropAction(Qt::DropAction action);
496 
497  QWidget* source() const;
498  inline const QMimeData *mimeData() const { return mdata; }
499 
500 // QT3_SUPPORT
501  const char* format(int n = 0) const;
502  QByteArray encodedData(const char*) const;
503  bool provides(const char*) const;
504 // END QT3_SUPPORT
505 #ifdef QT3_SUPPORT
506  inline void accept() { QEvent::accept(); }
507  inline QT3_SUPPORT void accept(bool y) { setAccepted(y); }
508  inline QT3_SUPPORT QByteArray data(const char* f) const { return encodedData(f); }
509 
510  enum Action { Copy, Link, Move, Private, UserAction = Private };
511  QT3_SUPPORT Action action() const;
512  inline QT3_SUPPORT void acceptAction(bool y = true) { if (y) { drop_action = default_action; accept(); } }
513  inline QT3_SUPPORT void setPoint(const QPoint& np) { p = np; }
514 #endif
515 
516 
517 protected:
518  friend class QApplication;
520  Qt::MouseButtons mouseState;
521  Qt::KeyboardModifiers modState;
522  Qt::DropActions act;
525  const QMimeData *mdata;
526  mutable QList<QByteArray> fmts; // only used for QT3_SUPPORT
527 };
528 
529 
531 {
532 public:
533  QDragMoveEvent(const QPoint &pos, Qt::DropActions actions, const QMimeData *data,
534  Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Type type = DragMove);
535  ~QDragMoveEvent();
536 
537  inline QRect answerRect() const { return rect; }
538 
539  inline void accept() { QDropEvent::accept(); }
540  inline void ignore() { QDropEvent::ignore(); }
541 
542  inline void accept(const QRect & r) { accept(); rect = r; }
543  inline void ignore(const QRect & r) { ignore(); rect = r; }
544 
545 #ifdef QT3_SUPPORT
546  inline QT3_SUPPORT void accept(bool y) { setAccepted(y); }
547 #endif
548 
549 protected:
550  friend class QApplication;
552 };
553 
554 
556 {
557 public:
558  QDragEnterEvent(const QPoint &pos, Qt::DropActions actions, const QMimeData *data,
559  Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers);
560  ~QDragEnterEvent();
561 };
562 
563 
564 /* An internal class */
566 {
567 public:
568  QDragResponseEvent(bool accepted);
570 
571  inline bool dragAccepted() const { return a; }
572 protected:
573  bool a;
574 };
575 
576 
578 {
579 public:
580  QDragLeaveEvent();
581  ~QDragLeaveEvent();
582 };
583 #endif // QT_NO_DRAGANDDROP
584 
585 
587 {
588 public:
589  QHelpEvent(Type type, const QPoint &pos, const QPoint &globalPos);
590  ~QHelpEvent();
591 
592  inline int x() const { return p.x(); }
593  inline int y() const { return p.y(); }
594  inline int globalX() const { return gp.x(); }
595  inline int globalY() const { return gp.y(); }
596 
597  inline const QPoint& pos() const { return p; }
598  inline const QPoint& globalPos() const { return gp; }
599 
600 private:
603 };
604 
605 #ifndef QT_NO_STATUSTIP
607 {
608 public:
609  QStatusTipEvent(const QString &tip);
610  ~QStatusTipEvent();
611 
612  inline QString tip() const { return s; }
613 private:
615 };
616 #endif
617 
618 #ifndef QT_NO_WHATSTHIS
620 {
621 public:
622  QWhatsThisClickedEvent(const QString &href);
624 
625  inline QString href() const { return s; }
626 private:
628 };
629 #endif
630 
631 #ifndef QT_NO_ACTION
633 {
634  QAction *act, *bef;
635 public:
636  QActionEvent(int type, QAction *action, QAction *before = 0);
637  ~QActionEvent();
638 
639  inline QAction *action() const { return act; }
640  inline QAction *before() const { return bef; }
641 };
642 #endif
643 
645 {
646 public:
647  QFileOpenEvent(const QString &file);
648  QFileOpenEvent(const QUrl &url);
649 #ifdef Q_OS_SYMBIAN
650  QFileOpenEvent(const RFile &fileHandle);
651 #endif
652  ~QFileOpenEvent();
653 
654  inline QString file() const { return f; }
655  QUrl url() const;
656  bool openFile(QFile &file, QIODevice::OpenMode flags) const;
657 private:
659 };
660 
661 #ifndef QT_NO_TOOLBAR
663 {
664 public:
665  QToolBarChangeEvent(bool t);
667 
668  inline bool toggle() const { return tog; }
669 private:
670  uint tog : 1;
671 };
672 #endif
673 
674 #ifndef QT_NO_SHORTCUT
676 {
677 public:
678  QShortcutEvent(const QKeySequence &key, int id, bool ambiguous = false);
679  ~QShortcutEvent();
680 
681  inline const QKeySequence &key() { return sequence; }
682  inline const QKeySequence &key() const { return sequence; }
683  inline int shortcutId() { return sid; }
684  inline int shortcutId() const { return sid; }
685  inline bool isAmbiguous() { return ambig; }
686  inline bool isAmbiguous() const { return ambig; }
687 protected:
689  bool ambig;
690  int sid;
691 };
692 #endif
693 
694 #ifndef QT_NO_CLIPBOARD
696 {
697 public:
698  QClipboardEvent(QEventPrivate *data);
699  ~QClipboardEvent();
700 
701  QEventPrivate *data() { return d; }
702 };
703 #endif
704 
706 {
707 public:
708  QWindowStateChangeEvent(Qt::WindowStates aOldState);
709  QWindowStateChangeEvent(Qt::WindowStates aOldState, bool isOverride);
711 
712  inline Qt::WindowStates oldState() const { return ostate; }
713  bool isOverride() const;
714 
715 private:
716  Qt::WindowStates ostate;
717 };
718 
719 #ifdef QT3_SUPPORT
720 class QMenuBar;
721 class Q_GUI_EXPORT QMenubarUpdatedEvent: public QEvent
722 {
723 public:
724  QMenubarUpdatedEvent(QMenuBar * const menBar);
725  inline QMenuBar *menuBar() { return m_menuBar; }
726 private:
727  QMenuBar *m_menuBar;
728 };
729 #endif
730 
731 #ifndef QT_NO_DEBUG_STREAM
733 #endif
734 
735 #ifndef QT_NO_SHORTCUT
736 inline bool operator==(QKeyEvent *e, QKeySequence::StandardKey key){return (e ? e->matches(key) : false);}
737 inline bool operator==(QKeySequence::StandardKey key, QKeyEvent *e){return (e ? e->matches(key) : false);}
738 #endif // QT_NO_SHORTCUT
739 
742 {
743 public:
745  {
746  public:
747  TouchPoint(int id = -1);
748  TouchPoint(const QTouchEvent::TouchPoint &other);
749  ~TouchPoint();
750 
751  int id() const;
752 
753  Qt::TouchPointState state() const;
754  bool isPrimary() const;
755 
756  QPointF pos() const;
757  QPointF startPos() const;
758  QPointF lastPos() const;
759 
760  QPointF scenePos() const;
761  QPointF startScenePos() const;
762  QPointF lastScenePos() const;
763 
764  QPointF screenPos() const;
765  QPointF startScreenPos() const;
766  QPointF lastScreenPos() const;
767 
768  QPointF normalizedPos() const;
769  QPointF startNormalizedPos() const;
770  QPointF lastNormalizedPos() const;
771 
772  QRectF rect() const;
773  QRectF sceneRect() const;
774  QRectF screenRect() const;
775 
776  qreal pressure() const;
777 
778  // internal
779  void setId(int id);
780  void setState(Qt::TouchPointStates state);
781  void setPos(const QPointF &pos);
782  void setScenePos(const QPointF &scenePos);
783  void setScreenPos(const QPointF &screenPos);
784  void setNormalizedPos(const QPointF &normalizedPos);
785  void setStartPos(const QPointF &startPos);
786  void setStartScenePos(const QPointF &startScenePos);
787  void setStartScreenPos(const QPointF &startScreenPos);
788  void setStartNormalizedPos(const QPointF &startNormalizedPos);
789  void setLastPos(const QPointF &lastPos);
790  void setLastScenePos(const QPointF &lastScenePos);
791  void setLastScreenPos(const QPointF &lastScreenPos);
792  void setLastNormalizedPos(const QPointF &lastNormalizedPos);
793  void setRect(const QRectF &rect);
794  void setSceneRect(const QRectF &sceneRect);
795  void setScreenRect(const QRectF &screenRect);
796  void setPressure(qreal pressure);
797  QTouchEvent::TouchPoint &operator=(const QTouchEvent::TouchPoint &other);
798 
799  private:
801  friend class QApplication;
802  friend class QApplicationPrivate;
803  };
804 
805  enum DeviceType {
807  TouchPad
808  };
809 
810  QTouchEvent(QEvent::Type eventType,
811  QTouchEvent::DeviceType deviceType = TouchScreen,
812  Qt::KeyboardModifiers modifiers = Qt::NoModifier,
813  Qt::TouchPointStates touchPointStates = 0,
815  ~QTouchEvent();
816 
817  inline QWidget *widget() const { return _widget; }
818  inline QTouchEvent::DeviceType deviceType() const { return _deviceType; }
819  inline Qt::TouchPointStates touchPointStates() const { return _touchPointStates; }
820  inline const QList<QTouchEvent::TouchPoint> &touchPoints() const { return _touchPoints; }
821 
822  // internal
823  inline void setWidget(QWidget *awidget) { _widget = awidget; }
824  inline void setDeviceType(DeviceType adeviceType) { _deviceType = adeviceType; }
825  inline void setTouchPointStates(Qt::TouchPointStates aTouchPointStates) { _touchPointStates = aTouchPointStates; }
826  inline void setTouchPoints(const QList<QTouchEvent::TouchPoint> &atouchPoints) { _touchPoints = atouchPoints; }
827 
828 protected:
831  Qt::TouchPointStates _touchPointStates;
833 
834  friend class QApplication;
835  friend class QApplicationPrivate;
836 };
837 
838 #ifndef QT_NO_GESTURES
839 class QGesture;
842 {
843 public:
844  QGestureEvent(const QList<QGesture *> &gestures);
845  ~QGestureEvent();
846 
847  QList<QGesture *> gestures() const;
848  QGesture *gesture(Qt::GestureType type) const;
849 
850  QList<QGesture *> activeGestures() const;
851  QList<QGesture *> canceledGestures() const;
852 
853 #ifdef Q_NO_USING_KEYWORD
854  inline void setAccepted(bool accepted) { QEvent::setAccepted(accepted); }
855  inline bool isAccepted() const { return QEvent::isAccepted(); }
856 
857  inline void accept() { QEvent::accept(); }
858  inline void ignore() { QEvent::ignore(); }
859 #else
860  using QEvent::setAccepted;
861  using QEvent::isAccepted;
862  using QEvent::accept;
863  using QEvent::ignore;
864 #endif
865 
866  void setAccepted(QGesture *, bool);
867  void accept(QGesture *);
868  void ignore(QGesture *);
869  bool isAccepted(QGesture *) const;
870 
871  void setAccepted(Qt::GestureType, bool);
872  void accept(Qt::GestureType);
873  void ignore(Qt::GestureType);
874  bool isAccepted(Qt::GestureType) const;
875 
876  void setWidget(QWidget *widget);
877  QWidget *widget() const;
878 
879 #ifndef QT_NO_GRAPHICSVIEW
880  QPointF mapToGraphicsScene(const QPointF &gesturePoint) const;
881 #endif
882 
883 private:
884  QGestureEventPrivate *d_func();
885  const QGestureEventPrivate *d_func() const;
886 
887  friend class QApplication;
888  friend class QGestureManager;
889 };
890 #endif // QT_NO_GESTURES
891 
893 
895 
896 #endif // QEVENT_H
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:92
TabletDevice
This enum defines what type of device is generating the event.
Definition: qevent.h:182
The QDebug class provides an output stream for debugging information.
Definition: qdebug.h:62
QAction * before() const
If type() is ActionAdded , returns the action that should appear before action(). ...
Definition: qevent.h:640
double d
Definition: qnumeric_p.h:62
QString txt
Definition: qevent.h:268
const QString & preeditString() const
Returns the preedit text, i.
Definition: qevent.h:455
void acceptProposedAction()
Sets the drop action to be the proposed action.
Definition: qevent.h:492
Qt::WindowStates oldState() const
Returns the state of the window before the change.
Definition: qevent.h:712
The QApplication class manages the GUI application&#39;s control flow and main settings.
Definition: qapplication.h:99
The QKeyEvent class describes a key event.
Definition: qevent.h:224
int type
Definition: qmetatype.cpp:239
QTouchEvent::DeviceType _deviceType
Definition: qevent.h:830
double qreal
Definition: qglobal.h:1193
void ignore(const QRect &r)
The opposite of the accept(const QRect&) function.
Definition: qevent.h:543
Qt::DropActions act
Definition: qevent.h:522
QSize s
Definition: qevent.h:358
unsigned char c[8]
Definition: qnumeric_p.h:62
int y() const
Returns the y position of the mouse pointer, relative to the widget that received the event...
Definition: qevent.h:408
int replace_length
Definition: qevent.h:468
int replacementStart() const
Returns the position at which characters are to be replaced relative from the start of the preedit st...
Definition: qevent.h:458
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
QPointer< QWidget > widget
#define QT_MODULE(x)
Definition: qglobal.h:2783
The QInputMethodEvent::Attribute class stores an input method attribute.
Definition: qevent.h:441
Qt::MouseButtons mouseState
Definition: qevent.h:173
bool hasExtendedInfo() const
Definition: qevent.h:246
int y() const
Returns the y position of the device, relative to the widget that received the event.
Definition: qevent.h:195
#define QT_BEGIN_HEADER
Definition: qglobal.h:136
Qt::DropActions possibleActions() const
Returns an OR-combination of possible drop actions.
Definition: qevent.h:490
int xTilt() const
Returns the angle between the device (a pen, for example) and the perpendicular in the direction of t...
Definition: qevent.h:207
The QWheelEvent class contains parameters that describe a wheel event.
Definition: qevent.h:139
The QContextMenuEvent class contains parameters that describe a context menu event.
Definition: qevent.h:396
Qt::TouchPointStates _touchPointStates
Definition: qevent.h:831
const QPoint & pos() const
Returns the position of the mouse pointer relative to the widget that received the event...
Definition: qevent.h:412
#define Q_GUI_EXPORT
Definition: qglobal.h:1450
Reason
This enum describes the reason why the event was sent.
Definition: qevent.h:399
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
qreal hiResGlobalX() const
The high precision x position of the tablet device.
Definition: qevent.h:198
The QHoverEvent class contains parameters that describe a mouse event.
Definition: qevent.h:125
void setAccepted(bool accepted)
Definition: qcoreevent.h:306
QPoint p
Definition: qevent.h:135
The QPointF class defines a point in the plane using floating point precision.
Definition: qpoint.h:214
uint autor
Definition: qevent.h:271
static Qt::MouseButtons buttons
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
Qt::DropAction dropAction() const
Returns the action to be performed on the data by the target.
Definition: qevent.h:494
The QShortcutEvent class provides an event which is generated when the user presses a key combination...
Definition: qevent.h:675
static bool ignore(const char *test, const char *const *table)
Definition: qaxserver.cpp:660
void accept()
Calls QDropEvent::accept().
Definition: qevent.h:539
QList< Attribute > attrs
Definition: qevent.h:465
const QPointF & hiResGlobalPos() const
The high precision coordinates delivered from the tablet expressed.
Definition: qevent.h:193
long ASN1_INTEGER_get ASN1_INTEGER * a
StandardKey
This enum represent standard key bindings.
Definition: qkeysequence.h:75
int globalX() const
Returns the global x position of the mouse cursor at the time of the event.
Definition: qevent.h:155
The QActionEvent class provides an event that is generated when a QAction is added, removed, or changed.
Definition: qevent.h:632
Qt::MouseButtons mouseState
Definition: qevent.h:122
Qt::Orientation o
Definition: qevent.h:174
int globalY() const
Returns the global y position of the tablet device at the time of the event.
Definition: qevent.h:197
const QPoint & oldPos() const
Returns the old position of the widget.
Definition: qevent.h:341
bool isAmbiguous() const
Returns true if the key sequence that triggered the event is ambiguous.
Definition: qevent.h:686
The QUrl class provides a convenient interface for working with URLs.
Definition: qurl.h:61
The QString class provides a Unicode character string.
Definition: qstring.h:83
The QDragMoveEvent class provides an event which is sent while a drag and drop action is in progress...
Definition: qevent.h:530
DeviceType
This enum represents the type of device that generated a QTouchEvent.
Definition: qevent.h:805
const QPoint & pos() const
Returns the position of the device, relative to the widget that received the event.
Definition: qevent.h:191
Qt::KeyboardModifiers keyboardModifiers() const
Returns the modifier keys that are pressed.
Definition: qevent.h:488
Qt::FocusReason m_reason
Definition: qevent.h:294
void setTouchPointStates(Qt::TouchPointStates aTouchPointStates)
Sets a bitwise OR of all the touch point states for this event.
Definition: qevent.h:825
qint64 mUnique
Definition: qevent.h:215
The QMimeSource class is an abstraction of objects that provided formatted data of a certain MIME typ...
Definition: qmime.h:53
const QPoint & pos() const
Returns the position of the mouse cursor, relative to the widget that received the event...
Definition: qevent.h:95
PointerType pointerType() const
Returns the type of point that generated the event.
Definition: qevent.h:201
QRegion m_region
Definition: qevent.h:331
QKeySequence sequence
Definition: qevent.h:688
Qt::DropAction default_action
Definition: qevent.h:524
const QPoint & oldPos() const
Returns the previous position of the mouse cursor, relative to the widget that received the event...
Definition: qevent.h:132
bool lostFocus() const
Returns true if type() is QEvent::FocusOut; otherwise returns false.
Definition: qevent.h:282
int key() const
Returns the code of the key that was pressed or released.
Definition: qevent.h:231
QString preedit
Definition: qevent.h:464
QString href() const
Returns the URL that was clicked by the user in the "What&#39;s This?" text.
Definition: qevent.h:625
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:457
Qt::WindowStates ostate
Definition: qevent.h:716
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
QList< QTouchEvent::TouchPoint > _touchPoints
Definition: qevent.h:832
Qt::KeyboardModifiers modState
Definition: qevent.h:521
The QGestureEvent class provides the description of triggered gestures.
Definition: qevent.h:841
The QMoveEvent class contains event parameters for move events.
Definition: qevent.h:334
The QRectF class defines a rectangle in the plane using floating point precision. ...
Definition: qrect.h:511
QPoint p
Definition: qevent.h:170
bool isAccepted() const
Definition: qcoreevent.h:307
int y() const
Returns the y position of the mouse cursor, relative to the widget that received the event...
Definition: qevent.h:154
QWidget * widget() const
Returns the widget on which the event occurred.
Definition: qevent.h:817
int globalX() const
Returns the global x position of the mouse pointer at the time of the event.
Definition: qevent.h:196
qint64 uniqueId() const
Returns a unique ID for the current device, making it possible to differentiate between multiple devi...
Definition: qevent.h:202
int y() const
Same as pos().
Definition: qevent.h:593
QTouchEvent::DeviceType deviceType() const
Returns the touch device Type, which is of type QTouchEvent::DeviceType {DeviceType}.
Definition: qevent.h:818
QRect answerRect() const
Returns the rectangle in the widget where the drop will occur if accepted.
Definition: qevent.h:537
ushort c
Definition: qevent.h:270
bool hasExtendedInfo() const
Definition: qevent.h:107
QRect rect
Definition: qevent.h:551
The QHideEvent class provides an event which is sent after a widget is hidden.
Definition: qevent.h:388
QString tip() const
Returns the message to show in the status bar.
Definition: qevent.h:612
The QResizeEvent class contains event parameters for resize events.
Definition: qevent.h:349
const QRegion & region() const
Returns the region that needs to be updated.
Definition: qevent.h:306
int globalX() const
Returns the global x position of the mouse cursor at the time of the event.
Definition: qevent.h:99
int delta() const
Returns the distance that the wheel is rotated, in eighths of a degree.
Definition: qevent.h:150
static const char * data(const QByteArray &arr)
Qt::MouseButtons buttons() const
Returns the mouse state when the event occurred.
Definition: qevent.h:158
unsigned int uint
Definition: qglobal.h:996
Qt::TouchPointStates touchPointStates() const
Returns a bitwise OR of all the touch point states for this event.
Definition: qevent.h:819
QAction * action() const
Returns the action that is changed, added, or removed.
Definition: qevent.h:639
const QSize & oldSize() const
Returns the old size of the widget.
Definition: qevent.h:356
QPoint mPos
Definition: qevent.h:211
int count() const
Returns the number of keys involved in this event.
Definition: qevent.h:238
The QDragLeaveEvent class provides an event that is sent to a widget when a drag and drop action leav...
Definition: qevent.h:577
The QRegion class specifies a clip region for a painter.
Definition: qregion.h:68
const QList< Attribute > & attributes() const
Returns the list of attributes passed to the QInputMethodEvent constructor.
Definition: qevent.h:454
DropAction
Definition: qnamespace.h:1597
const QRegion & region() const
Definition: qevent.h:328
__int64 qint64
Definition: qglobal.h:942
QPointF mHiResGlobalPos
Definition: qevent.h:212
QList< QByteArray > fmts
Definition: qevent.h:526
int globalX() const
Returns the global x position of the mouse pointer at the time of the event.
Definition: qevent.h:409
The QShowEvent class provides an event that is sent when a widget is shown.
Definition: qevent.h:380
The QMimeData class provides a container for data that records information about its MIME type...
Definition: qmimedata.h:57
const QMimeData * mdata
Definition: qevent.h:525
Qt::DropAction proposedAction() const
Returns the proposed drop action.
Definition: qevent.h:491
Qt::Orientation orientation() const
Returns the wheel&#39;s orientation.
Definition: qevent.h:159
int globalY() const
Returns the global y position of the mouse pointer at the time of the event.
Definition: qevent.h:410
Qt::MouseButton button() const
Returns the button that caused the event.
Definition: qevent.h:101
GestureType
Definition: qnamespace.h:1759
QAction * bef
Definition: qevent.h:634
int k
Definition: qevent.h:269
The QTabletEvent class contains parameters that describe a Tablet event.
Definition: qevent.h:179
QString file() const
Returns the file that is being opened.
Definition: qevent.h:654
Reason reason() const
Returns the reason for this context event.
Definition: qevent.h:415
The QMouseEvent class contains parameters that describe a mouse event.
Definition: qevent.h:85
qreal hiResGlobalY() const
The high precision y position of the tablet device.
Definition: qevent.h:199
const QKeySequence & key()
Definition: qevent.h:681
const QPoint & pos() const
Returns the position of the mouse cursor relative to the widget that received the event...
Definition: qevent.h:151
QEventPrivate * d
Definition: qcoreevent.h:315
The QInputMethodEvent class provides parameters for input method events.
Definition: qevent.h:431
qreal pressure() const
Returns the pressure for the device.
Definition: qevent.h:203
int shortcutId()
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: qevent.h:683
PointerType
This enum defines what type of point is generating the event.
Definition: qevent.h:184
The QCoreApplication class provides an event loop for console Qt applications.
Qt::MouseButtons mouseButtons() const
Returns the mouse buttons that are pressed.
Definition: qevent.h:487
const QPoint & pos() const
Returns the new position of the widget.
Definition: qevent.h:340
The QDropEvent class provides an event which is sent when a drag and drop action is completed...
Definition: qevent.h:476
The QMenuBar class provides a horizontal menu bar.
Definition: qmenubar.h:62
const QPoint & pos() const
Returns the position of the mouse cursor, relative to the widget that received the event...
Definition: qevent.h:131
Qt::MouseButtons mouseState
Definition: qevent.h:520
void accept(const QRect &r)
The same as accept(), but also notifies that future moves will also be acceptable if they remain with...
Definition: qevent.h:542
QString f
Definition: qevent.h:658
int z() const
Returns the z position of the device.
Definition: qevent.h:204
The QKeySequence class encapsulates a key sequence as used by shortcuts.
Definition: qkeysequence.h:72
Qt::MouseButtons buttons() const
Returns the button state when the event was generated.
Definition: qevent.h:102
The QWindowStateChangeEvent class provides the window state before a window state change...
Definition: qevent.h:705
The QFile class provides an interface for reading from and writing to files.
Definition: qfile.h:65
FocusReason
Definition: qnamespace.h:1521
Type
This enum type defines the valid event types in Qt.
Definition: qcoreevent.h:62
QInputEvent(Type type, Qt::KeyboardModifiers modifiers=Qt::NoModifier)
Definition: qevent.cpp:77
The QGesture class represents a gesture, containing properties that describe the corresponding user i...
Definition: qgesture.h:64
bool m_erased
Definition: qevent.h:319
QString text() const
Returns the Unicode text that this key generated.
Definition: qevent.h:236
unsigned short ushort
Definition: qglobal.h:995
The QStatusTipEvent class provides an event that is used to show messages in a status bar...
Definition: qevent.h:606
const QSize & size() const
Returns the new size of the widget.
Definition: qevent.h:355
Qt::MouseButton b
Definition: qevent.h:121
int y() const
Returns the y position of the mouse cursor, relative to the widget that received the event...
Definition: qevent.h:98
const QPoint & globalPos() const
Returns the global position of the device at the time of the event.
Definition: qevent.h:192
int globalY() const
Returns the global y position of the mouse cursor at the time of the event.
Definition: qevent.h:100
The QDragEnterEvent class provides an event which is sent to a widget when a drag and drop action ent...
Definition: qevent.h:555
The QWhatsThisClickedEvent class provides an event that can be used to handle hyperlinks in a "What&#39;s...
Definition: qevent.h:619
void setDeviceType(DeviceType adeviceType)
Sets the device type to deviceType, which is of type QTouchEvent::DeviceType {DeviceType}.
Definition: qevent.h:824
int key
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
bool toggle() const
Definition: qevent.h:668
const QList< QTouchEvent::TouchPoint > & touchPoints() const
Returns the list of touch points contained in the touch event.
Definition: qevent.h:820
void * mExtra
Definition: qevent.h:220
int yTilt() const
Returns the angle between the device (a pen, for example) and the perpendicular in the direction of t...
Definition: qevent.h:208
QPoint p
Definition: qevent.h:343
unsigned int quint32
Definition: qglobal.h:938
qreal tangentialPressure() const
Returns the tangential pressure for the device.
Definition: qevent.h:205
Qt::DropAction drop_action
Definition: qevent.h:523
QString s
Definition: qevent.h:614
TouchPointState
This enum represents the state of a touch point at the time the QTouchEvent occurred.
Definition: qnamespace.h:1738
const QPoint & globalPos() const
Returns the mouse cursor position when the event was generated in global coordinates.
Definition: qevent.h:598
QTouchEventTouchPointPrivate * d
Definition: qevent.h:800
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
QFactoryLoader * l
QRect m_rect
Definition: qevent.h:317
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:237
const QPoint & globalPos() const
Returns the global position of the mouse pointer at the time of the event.
Definition: qevent.h:152
const QKeySequence & key() const
Returns the key sequence that triggered the event.
Definition: qevent.h:682
The QToolBarChangeEvent class provides an event that is sent whenever a the toolbar button is clicked...
Definition: qevent.h:662
int globalY() const
Returns the global y position of the mouse cursor at the time of the event.
Definition: qevent.h:156
Qt::KeyboardModifiers modState
Definition: qevent.h:82
The TouchPoint class provides information about a touch point in a QTouchEvent.
Definition: qevent.h:744
int x() const
Returns the x position of the mouse pointer, relative to the widget that received the event...
Definition: qevent.h:407
QPoint p
Definition: qevent.h:120
int shortcutId() const
Returns the ID of the QShortcut object for which this event was generated.
Definition: qevent.h:684
int x() const
Returns the x position of the device, relative to the widget that received the event.
Definition: qevent.h:194
int globalX() const
Same as globalPos().
Definition: qevent.h:594
The QInputEvent class is the base class for events that describe user input.
Definition: qevent.h:74
void ignore()
Clears the accept flag parameter of the event object, the equivalent of calling setAccepted(false).
Definition: qcoreevent.h:310
void accept()
Sets the accept flag of the event object, the equivalent of calling setAccepted(true).
Definition: qcoreevent.h:309
The QTouchEvent class contains parameters that describe a touch event.
Definition: qevent.h:741
The QClipboardEvent class provides the parameters used in a clipboard event.
Definition: qevent.h:695
const QMimeData * mimeData() const
Returns the data that was dropped on the widget and its associated MIME type information.
Definition: qevent.h:498
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53
QRegion m_region
Definition: qevent.h:318
void setWidget(QWidget *awidget)
Definition: qevent.h:823
bool isAmbiguous()
Definition: qevent.h:685
int replacementLength() const
Returns the number of characters to be replaced in the preedit string.
Definition: qevent.h:459
QPoint gp
Definition: qevent.h:602
bool ambig
Definition: qevent.h:689
const QPoint & globalPos() const
Returns the global position of the mouse pointer at the time of the event.
Definition: qevent.h:413
bool gotFocus() const
Returns true if type() is QEvent::FocusIn; otherwise returns false.
Definition: qevent.h:281
qreal rotation() const
Returns the rotation of the current device in degress.
Definition: qevent.h:206
void setModifiers(Qt::KeyboardModifiers amodifiers)
Sets the keyboard modifiers flags for this event.
Definition: qevent.h:80
const QRect & rect() const
Returns the rectangle that needs to be updated.
Definition: qevent.h:305
QPoint p
Definition: qevent.h:519
QEventPrivate * data()
Definition: qevent.h:701
Qt::KeyboardModifiers modifiers() const
Returns the keyboard modifier flags that existed immediately before the event occurred.
Definition: qevent.h:79
int x() const
Same as pos().
Definition: qevent.h:592
The QPaintEvent class contains event parameters for paint events.
Definition: qevent.h:298
void setTouchPoints(const QList< QTouchEvent::TouchPoint > &atouchPoints)
Sets the list of touch points for this event.
Definition: qevent.h:826
qreal mTangential
Definition: qevent.h:214
Orientation
Definition: qnamespace.h:174
The QIconDragEvent class indicates that a main icon drag has begun.
Definition: qevent.h:372
The QEvent class is the base class of all event classes.
Definition: qcoreevent.h:56
QPoint g
Definition: qevent.h:171
Type type() const
Returns the event type.
Definition: qcoreevent.h:303
AttributeType
A QTextCharFormat for the part of the preedit string specified by start and length.
Definition: qevent.h:434
const QPoint & globalPos() const
Returns the global position of the mouse cursor at the time of the event.
Definition: qevent.h:96
#define QT_END_HEADER
Definition: qglobal.h:137
bool operator==(QKeyEvent *e, QKeySequence::StandardKey key)
Definition: qevent.h:736
void ignore()
Calls QDropEvent::ignore().
Definition: qevent.h:540
The QCloseEvent class contains parameters that describe a close event.
Definition: qevent.h:364
QWidget * _widget
Definition: qevent.h:829
Q_GUI_EXPORT QDebug operator<<(QDebug, const QEvent *)
Definition: qevent.cpp:3639
The QFocusEvent class contains event parameters for widget focus events.
Definition: qevent.h:275
QPoint p
Definition: qevent.h:601
The QAction class provides an abstract user interface action that can be inserted into widgets...
Definition: qaction.h:64
bool dragAccepted() const
Definition: qevent.h:571
Attribute(AttributeType t, int s, int l, QVariant val)
Constructs an input method attribute.
Definition: qevent.h:443
TabletDevice device() const
Returns the type of device that generated the event.
Definition: qevent.h:200
const QPoint & pos() const
Returns the position where the drop was made.
Definition: qevent.h:486
int x() const
Returns the x position of the mouse cursor, relative to the widget that received the event...
Definition: qevent.h:153
#define text
Definition: qobjectdefs.h:80
QString commit
Definition: qevent.h:466
bool matches(QKeySequence::StandardKey key) const
Returns true if the key event matches the given standard key; otherwise returns false.
Definition: qevent.cpp:1023
int x() const
Returns the x position of the mouse cursor, relative to the widget that received the event...
Definition: qevent.h:97
int globalY() const
Same as globalPos().
Definition: qevent.h:595
The QFileOpenEvent class provides an event that will be sent when there is a request to open a file o...
Definition: qevent.h:644
The QHelpEvent class provides an event that is used to request helpful information about a particular...
Definition: qevent.h:586
MouseButton
Definition: qnamespace.h:150
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:597