8#pragma qt_class(QtEvents)
11#include <QtGui/qtguiglobal.h>
13#include <QtCore/qcoreevent.h>
14#include <QtCore/qiodevice.h>
15#include <QtCore/qlist.h>
16#include <QtCore/qnamespace.h>
17#include <QtCore/qstring.h>
18#include <QtCore/qurl.h>
19#include <QtCore/qvariant.h>
20#include <QtGui/qeventpoint.h>
21#include <QtGui/qpointingdevice.h>
22#include <QtGui/qregion.h>
23#include <QtGui/qwindowdefs.h>
25#if QT_CONFIG(shortcut)
26# include <QtGui/qkeysequence.h>
39#if QT_CONFIG(shortcut)
44#if QT_CONFIG(gestures)
56 inline Qt::KeyboardModifiers
modifiers()
const {
return m_modState; }
84 void setTimestamp(
quint64 timestamp)
override;
87 const QList<QEventPoint> &
points()
const {
return m_points; }
89 bool allPointsGrabbed()
const;
93 bool allPointsAccepted()
const;
94 virtual void setAccepted(
bool accepted)
override;
97 QList<QPointer <QObject>> passiveGrabbers(
const QEventPoint &point)
const;
98 void clearPassiveGrabbers(
const QEventPoint &point);
112 WRITE setExclusivePointGrabber)
117 inline Qt::MouseButtons
buttons()
const {
return m_mouseState; }
120 {
Q_ASSERT(!m_points.isEmpty());
return m_points.first().position(); }
122 {
Q_ASSERT(!m_points.isEmpty());
return m_points.first().scenePosition(); }
124 {
Q_ASSERT(!m_points.isEmpty());
return m_points.first().globalPosition(); }
126 bool isBeginEvent()
const override;
127 bool isUpdateEvent()
const override;
128 bool isEndEvent()
const override;
136 friend class ::tst_QEvent;
171#if QT_DEPRECATED_SINCE(6, 0)
172#ifndef QT_NO_INTEGER_EVENT_COORDINATES
176 inline QPoint globalPos()
const {
return globalPosition().
toPoint(); }
182 inline int globalX()
const {
return qRound(globalPosition().
x()); }
184 inline int globalY()
const {
return qRound(globalPosition().
y()); }
189 QPointF windowPos()
const {
return scenePosition(); }
191 QPointF screenPos()
const {
return globalPosition(); }
199#if QT_DEPRECATED_SINCE(6, 4)
202 Qt::MouseButtons buttons, Qt::KeyboardModifiers
modifiers,
218#ifndef QT_NO_INTEGER_EVENT_COORDINATES
221#if QT_DEPRECATED_SINCE(6, 0)
222#ifndef QT_NO_INTEGER_EVENT_COORDINATES
224 inline
QPoint globalPos()
const {
return globalPosition().toPoint(); }
230 inline
int globalX()
const {
return qRound(globalPosition().
x()); }
232 inline
int globalY()
const {
return qRound(globalPosition().
y()); }
237 QPointF windowPos()
const {
return scenePosition(); }
239 QPointF screenPos()
const {
return globalPosition(); }
242 Qt::MouseEventFlags
flags()
const;
252#if QT_DEPRECATED_SINCE(6, 3)
259#if QT_DEPRECATED_SINCE(6, 0)
260#ifndef QT_NO_INTEGER_EVENT_COORDINATES
279#if QT_CONFIG(wheelevent)
291 enum { DefaultDeltasPerStep = 120 };
298 inline QPoint pixelDelta()
const {
return m_pixelDelta; }
299 inline QPoint angleDelta()
const {
return m_angleDelta; }
302 inline bool inverted()
const {
return m_invertedScrolling; }
303 inline bool isInverted()
const {
return m_invertedScrolling; }
304 inline bool hasPixelDelta()
const {
return !m_pixelDelta.isNull(); }
306 bool isBeginEvent()
const override;
307 bool isUpdateEvent()
const override;
308 bool isEndEvent()
const override;
317#if QT_CONFIG(tabletevent)
324 qreal pressure,
float xTilt,
float yTilt,
325 float tangentialPressure,
qreal rotation,
float z,
326 Qt::KeyboardModifiers keyState,
329#if QT_DEPRECATED_SINCE(6, 0)
333 inline
QPoint globalPos()
const {
return globalPosition().toPoint(); }
338 inline const
QPointF globalPosF()
const {
return globalPosition(); }
344 inline
int globalX()
const {
return qRound(globalPosition().
x()); }
346 inline
int globalY()
const {
return qRound(globalPosition().
y()); }
348 inline
qreal hiResGlobalX()
const {
return globalPosition().x(); }
350 inline
qreal hiResGlobalY()
const {
return globalPosition().y(); }
352 inline
qint64 uniqueId()
const {
return pointingDevice() ? pointingDevice()->uniqueId().numericId() : -1; }
356 inline qreal z()
const {
return m_z; }
357 inline qreal tangentialPressure()
const {
return m_tangential; }
358 inline qreal xTilt()
const {
return m_xTilt; }
359 inline qreal yTilt()
const {
return m_yTilt; }
369#if QT_CONFIG(gestures)
374#if QT_DEPRECATED_SINCE(6, 2)
384 int fingerCount()
const {
return m_fingerCount; }
387#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
388 return m_delta.toPointF();
394#if QT_DEPRECATED_SINCE(6, 0)
395#ifndef QT_NO_INTEGER_EVENT_COORDINATES
399 inline const
QPoint globalPos()
const {
return globalPosition().toPoint(); }
404 QPointF windowPos()
const {
return scenePosition(); }
406 QPointF screenPos()
const {
return globalPosition(); }
411#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
434 int key()
const {
return m_key; }
435#if QT_CONFIG(shortcut)
445 inline int count()
const {
return int(m_count); }
451#if QT_CONFIG(shortcut)
453 {
return (e ? e->matches(
key) :
false); }
455 {
return (e ? e->matches(
key) :
false); }
520#if QT_DEPRECATED_SINCE(6, 0)
522 inline const QRegion ®ion()
const {
return m_region; }
536 SurfaceAboutToBeDestroyed
592#ifndef QT_NO_CONTEXTMENU
601#if QT_DEPRECATED_SINCE(6, 4)
606 inline int x()
const {
return m_pos.x(); }
607 inline int y()
const {
return m_pos.y(); }
608 inline int globalX()
const {
return m_globalPos.x(); }
609 inline int globalY()
const {
return m_globalPos.y(); }
623#ifndef QT_NO_INPUTMETHOD
648 void setCommitString(
const QString &commitString,
int replaceFrom = 0,
int replaceLength = 0);
649 inline const QList<Attribute> &
attributes()
const {
return m_attributes; }
666 return !(lhs == rhs);
672 QList<Attribute> m_attributes;
673 int m_replacementStart;
674 int m_replacementLength;
684 Qt::InputMethodQueries
queries()
const {
return m_queries; }
689 Qt::InputMethodQueries m_queries;
694 friend QTypeInfo<QueryPair>;
695 QList<QueryPair> m_values;
701#if QT_CONFIG(draganddrop)
705class Q_GUI_EXPORT QDropEvent :
public QEvent
712#if QT_DEPRECATED_SINCE(6, 0)
718 inline
Qt::MouseButtons mouseButtons()
const {
return buttons(); }
720 inline
Qt::KeyboardModifiers keyboardModifiers()
const {
return modifiers(); }
724 inline Qt::MouseButtons buttons()
const {
return m_mouseState; }
725 inline Qt::KeyboardModifiers
modifiers()
const {
return m_modState; }
727 inline Qt::DropActions possibleActions()
const {
return m_actions; }
728 inline Qt::DropAction proposedAction()
const {
return m_defaultAction; }
729 inline void acceptProposedAction() { m_dropAction = m_defaultAction; accept(); }
740 Qt::MouseButtons m_mouseState;
741 Qt::KeyboardModifiers m_modState;
742 Qt::DropActions m_actions;
749class Q_GUI_EXPORT QDragMoveEvent :
public QDropEvent
754 Qt::MouseButtons buttons, Qt::KeyboardModifiers
modifiers,
Type type = DragMove);
756 inline QRect answerRect()
const {
return m_rect; }
758 inline void accept() { QDropEvent::accept(); }
759 inline void ignore() { QDropEvent::ignore(); }
761 inline void accept(
const QRect &
r) { accept(); m_rect =
r; }
762 inline void ignore(
const QRect &
r) { ignore(); m_rect =
r; }
769class Q_GUI_EXPORT QDragEnterEvent :
public QDragMoveEvent
774 Qt::MouseButtons buttons, Qt::KeyboardModifiers
modifiers);
778class Q_GUI_EXPORT QDragLeaveEvent :
public QEvent
793 inline int x()
const {
return m_pos.x(); }
794 inline int y()
const {
return m_pos.y(); }
795 inline int globalX()
const {
return m_globalPos.x(); }
796 inline int globalY()
const {
return m_globalPos.y(); }
806#ifndef QT_NO_STATUSTIP
819#if QT_CONFIG(whatsthis)
820class Q_GUI_EXPORT QWhatsThisClickedEvent :
public QEvent
824 explicit QWhatsThisClickedEvent(
const QString &href);
826 inline QString href()
const {
return m_href; }
839 inline QAction *action()
const {
return m_action; }
840 inline QAction *before()
const {
return m_before; }
856#if QT_DEPRECATED_SINCE(6, 6)
872 inline bool toggle()
const {
return m_toggle; }
878#if QT_CONFIG(shortcut)
889 inline int shortcutId()
const {
return m_shortcutId; }
890 inline bool isAmbiguous()
const {
return m_ambiguous; }
904 inline Qt::WindowStates
oldState()
const {
return m_oldStates; }
905 bool isOverride()
const;
908 Qt::WindowStates m_oldStates;
912#ifndef QT_NO_DEBUG_STREAM
925 const QList<QEventPoint> &touchPoints = {});
926#if QT_DEPRECATED_SINCE(6, 0)
937#if QT_DEPRECATED_SINCE(6, 0)
941 bool isBeginEvent()
const override;
942 bool isUpdateEvent()
const override;
943 bool isEndEvent()
const override;
IOBluetoothDevice * device
The QActionEvent class provides an event that is generated when a QAction is added,...
The QAction class provides an abstraction for user commands that can be added to different user inter...
Qt::ApplicationState applicationState() const
Returns the state of the application.
The QApplication class manages the GUI application's control flow and main settings.
QWindow * child() const
Returns the child window that was added or removed.
The QCloseEvent class contains parameters that describe a close event.
The QEventPoint class provides information about a point in a QPointerEvent.
Type
This enum type defines the valid event types in Qt.
The QExposeEvent class contains event parameters for expose events. \inmodule QtGui.
The QFileOpenEvent class provides an event that will be sent when there is a request to open a file o...
QUrl url() const
Returns the url that the application should open.
QString file() const
Returns the name of the file that the application should open.
The QFocusEvent class contains event parameters for widget focus events.
bool lostFocus() const
Returns true if type() is QEvent::FocusOut; otherwise returns false.
bool gotFocus() const
Returns true if type() is QEvent::FocusIn; otherwise returns false.
The QGesture class represents a gesture, containing properties that describe the corresponding user i...
The QHelpEvent class provides an event that is used to request helpful information about a particular...
int x() const
Same as pos().x().
const QPoint & globalPos() const
Returns the mouse cursor position when the event was generated in global coordinates.
const QPoint & pos() const
Returns the mouse cursor position when the event was generated, relative to the widget to which the e...
int y() const
Same as pos().y().
int globalY() const
Same as globalPos().y().
int globalX() const
Same as globalPos().x().
The QHideEvent class provides an event which is sent after a widget is hidden.
QPoint oldPos() const
Returns the previous position of the mouse cursor, relative to the widget that received the event.
QPointF oldPosF() const
Returns the previous position of the mouse cursor, relative to the widget that received the event.
bool isUpdateEvent() const override
\inmodule QtCore \reentrant
The QIconDragEvent class indicates that a main icon drag has begun.
The QKeyEvent class describes a key event.
int count() const
Returns the number of keys involved in this event.
quint32 nativeScanCode() const
QString text() const
Returns the Unicode text that this key generated.
quint32 nativeVirtualKey() const
bool isAutoRepeat() const
Returns true if this event comes from an auto-repeating key; returns false if it comes from an initia...
quint32 m_nativeModifiers
quint32 nativeModifiers() const
int key() const
Returns the code of the key that was pressed or released.
QKeyCombination keyCombination() const
Returns a QKeyCombination object containing both the key() and the modifiers() carried by this event.
The QKeySequence class encapsulates a key sequence as used by shortcuts.
QMouseEvent(Type type, const QPointF &localPos, const QPointF &scenePos, const QPointF &globalPos, Qt::MouseButton button, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Qt::MouseEventSource source, const QPointingDevice *device=QPointingDevice::primaryPointingDevice())
QMouseEvent(Type type, const QPointF &localPos, const QPointF &scenePos, const QPointF &globalPos, Qt::MouseButton button, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, const QPointingDevice *device=QPointingDevice::primaryPointingDevice())
The QMoveEvent class contains event parameters for move events.
const QPoint & oldPos() const
Returns the old position of the widget.
const QPoint & pos() const
Returns the new position of the widget.
The QNativeGestureEvent class contains parameters that describe a gesture event. \inmodule QtGui.
The QPaintEvent class contains event parameters for paint events.
const QRegion & region() const
Returns the region that needs to be updated.
const QRect & rect() const
Returns the rectangle that needs to be updated.
\inmodule QtCore\reentrant
constexpr QPoint toPoint() const
Rounds the coordinates of this point to the nearest integer, and returns a QPoint object with the rou...
\inmodule QtCore\reentrant
A base class for pointer events.
virtual bool isEndEvent() const
qsizetype pointCount() const
Returns the number of points in this pointer event.
QList< QEventPoint > m_points
void setExclusiveGrabber(const QEventPoint &point, QObject *exclusiveGrabber)
Informs the delivery logic that the given exclusiveGrabber is to receive all future update events and...
virtual bool isBeginEvent() const
QObject * exclusiveGrabber(const QEventPoint &point) const
Returns the object which has been set to receive all future update events and the release event conta...
QPointerEvent(Type type, const QPointingDevice *dev, Qt::KeyboardModifiers modifiers=Qt::NoModifier, const QList< QEventPoint > &points={})
QPointingDevice::PointerType pointerType() const
Returns the type of point that generated the event.
const QList< QEventPoint > & points() const
Returns a list of points in this pointer event.
QPointerEvent(Type type, SinglePointEventTag, const QInputDevice *dev, Qt::KeyboardModifiers modifiers=Qt::NoModifier)
virtual bool isUpdateEvent() const
The QPointingDevice class describes a device from which mouse, touch or tablet events originate.
static const QPointingDevice * primaryPointingDevice(const QString &seatName=QString())
Returns the primary pointing device (the core pointer, traditionally assumed to be a mouse) on the gi...
PointerType
This enum represents what is interacting with the pointing device.
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
The QRegion class specifies a clip region for a painter.
The QResizeEvent class contains event parameters for resize events.
const QSize & oldSize() const
Returns the old size of the widget.
const QSize & size() const
Returns the new size of the widget.
QScreen * screen() const
Returns the screen whose orientation changed.
Qt::ScreenOrientation orientation() const
Returns the orientation of the screen.
The QScreen class is used to query screen properties. \inmodule QtGui.
The QShortcutEvent class provides an event which is generated when the user presses a key combination...
The QShortcut class is used to create keyboard shortcuts.
The QShowEvent class provides an event that is sent when a widget is shown.
A base class for pointer events containing a single point, such as mouse events.
QPointF globalPosition() const
Returns the position of the point in this event on the screen or virtual desktop.
Qt::MouseEventSource m_source
QPointF position() const
Returns the position of the point in this event, relative to the widget or item that received the eve...
quint16 m_invertedScrolling
void setExclusivePointGrabber(QObject *exclusiveGrabber)
QSinglePointEvent(Type type, const QPointingDevice *dev, const QEventPoint &point, Qt::MouseButton button, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Qt::MouseEventSource source)
QSinglePointEvent(Type type, const QPointingDevice *dev, const QPointF &localPos, const QPointF &scenePos, const QPointF &globalPos, Qt::MouseButton button, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Qt::MouseEventSource source=Qt::MouseEventNotSynthesized)
QPointF scenePosition() const
Returns the position of the point in this event, relative to the window or scene.
Qt::MouseButton button() const
Returns the button that caused the event.
Qt::MouseButtons buttons() const
Returns the button state when the event was generated.
QObject * exclusivePointGrabber() const
The QStatusTipEvent class provides an event that is used to show messages in a status bar.
QString tip() const
Returns the message to show in the status bar.
\macro QT_RESTRICTED_CAST_FROM_ASCII
The QTouchEvent class contains parameters that describe a touch event.
QObject * target() const
Returns the target object within the window on which the event occurred.
QEventPoint::States touchPointStates() const
Returns a bitwise OR of all the touch point states for this event.
The QVector2D class represents a vector or vertex in 2D space.
Qt::WindowStates oldState() const
Returns the state of the window before the change.
EGLImageKHR int int EGLuint64KHR * modifiers
Combined button and popup list for selecting options.
@ MouseEventNotSynthesized
#define Q_DECL_EVENT_COMMON(Class)
static FILE * openFile(const QString &filename, const QString &mode)
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
Q_GUI_EXPORT QDebug operator<<(QDebug, const QEvent *)
int qRound(qfloat16 d) noexcept
static bool matches(const QJsonObject &object, const QString &osName, const QVersionNumber &kernelVersion, const QString &osRelease, const QOpenGLConfig::Gpu &gpu)
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat z
GLint GLint GLint GLint GLint x
[0]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLuint GLenum GLsizei length
GLenum GLenum GLsizei count
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLsizei GLsizei GLchar * source
GLfixed GLfixed GLint GLint GLfixed points
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
bool operator==(const QRandomGenerator &rng1, const QRandomGenerator &rng2)
#define QT_DEPRECATED_VERSION_X_6_3(text)
#define QT_DEPRECATED_VERSION_X_6_4(text)
#define QT_DEPRECATED_VERSION_X_6_6(text)
#define QT_DEPRECATED_VERSION_X_6_0(text)
#define QT_DEPRECATED_VERSION_X_6_2(text)
#define Q_DECLARE_TYPEINFO(TYPE, FLAGS)
unsigned long long quint64
settings setValue("DataPump/bgcolor", color)
QUrl url("example.com")
[constructor-url-reference]
setDropAction(proposedAction())
[0]