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/qpointer.h>
18#include <QtCore/qstring.h>
19#include <QtCore/qurl.h>
20#include <QtCore/qvariant.h>
21#include <QtGui/qeventpoint.h>
22#include <QtGui/qpointingdevice.h>
23#include <QtGui/qregion.h>
24#include <QtGui/qwindowdefs.h>
26#if QT_CONFIG(shortcut)
27# include <QtGui/qkeysequence.h>
39#if QT_CONFIG(shortcut)
44#if QT_CONFIG(gestures)
56 inline Qt::KeyboardModifiers
modifiers()
const {
return m_modState; }
83 void setTimestamp(
quint64 timestamp)
override;
88 bool allPointsGrabbed()
const;
92 bool allPointsAccepted()
const;
97 void clearPassiveGrabbers(
const QEventPoint &point);
111 WRITE setExclusivePointGrabber)
116 inline Qt::MouseButtons
buttons()
const {
return m_mouseState; }
119 {
Q_ASSERT(!m_points.isEmpty());
return m_points.first().position(); }
121 {
Q_ASSERT(!m_points.isEmpty());
return m_points.first().scenePosition(); }
123 {
Q_ASSERT(!m_points.isEmpty());
return m_points.first().globalPosition(); }
125 bool isBeginEvent()
const override;
126 bool isUpdateEvent()
const override;
127 bool isEndEvent()
const override;
135 friend class ::tst_QEvent;
170#if QT_DEPRECATED_SINCE(6, 0)
171#ifndef QT_NO_INTEGER_EVENT_COORDINATES
175 inline QPoint globalPos()
const {
return globalPosition().
toPoint(); }
181 inline int globalX()
const {
return qRound(globalPosition().
x()); }
183 inline int globalY()
const {
return qRound(globalPosition().
y()); }
188 QPointF windowPos()
const {
return scenePosition(); }
190 QPointF screenPos()
const {
return globalPosition(); }
198#if QT_DEPRECATED_SINCE(6, 4)
201 Qt::MouseButtons buttons, Qt::KeyboardModifiers
modifiers,
217#ifndef QT_NO_INTEGER_EVENT_COORDINATES
220#if QT_DEPRECATED_SINCE(6, 0)
221#ifndef QT_NO_INTEGER_EVENT_COORDINATES
223 inline
QPoint globalPos()
const {
return globalPosition().toPoint(); }
229 inline
int globalX()
const {
return qRound(globalPosition().
x()); }
231 inline
int globalY()
const {
return qRound(globalPosition().
y()); }
236 QPointF windowPos()
const {
return scenePosition(); }
238 QPointF screenPos()
const {
return globalPosition(); }
241 Qt::MouseEventFlags
flags()
const;
251#if QT_DEPRECATED_SINCE(6, 3)
258#if QT_DEPRECATED_SINCE(6, 0)
259#ifndef QT_NO_INTEGER_EVENT_COORDINATES
278#if QT_CONFIG(wheelevent)
290 enum { DefaultDeltasPerStep = 120 };
297 inline QPoint pixelDelta()
const {
return m_pixelDelta; }
298 inline QPoint angleDelta()
const {
return m_angleDelta; }
301 inline bool inverted()
const {
return m_invertedScrolling; }
302 inline bool isInverted()
const {
return m_invertedScrolling; }
303 inline bool hasPixelDelta()
const {
return !m_pixelDelta.isNull(); }
305 bool isBeginEvent()
const override;
306 bool isUpdateEvent()
const override;
307 bool isEndEvent()
const override;
316#if QT_CONFIG(tabletevent)
323 qreal pressure,
float xTilt,
float yTilt,
324 float tangentialPressure,
qreal rotation,
float z,
325 Qt::KeyboardModifiers keyState,
328#if QT_DEPRECATED_SINCE(6, 0)
332 inline
QPoint globalPos()
const {
return globalPosition().toPoint(); }
337 inline const
QPointF globalPosF()
const {
return globalPosition(); }
343 inline
int globalX()
const {
return qRound(globalPosition().
x()); }
345 inline
int globalY()
const {
return qRound(globalPosition().
y()); }
347 inline
qreal hiResGlobalX()
const {
return globalPosition().x(); }
349 inline
qreal hiResGlobalY()
const {
return globalPosition().y(); }
351 inline
qint64 uniqueId()
const {
return pointingDevice() ? pointingDevice()->uniqueId().numericId() : -1; }
355 inline qreal z()
const {
return m_z; }
356 inline qreal tangentialPressure()
const {
return m_tangential; }
357 inline qreal xTilt()
const {
return m_xTilt; }
358 inline qreal yTilt()
const {
return m_yTilt; }
368#if QT_CONFIG(gestures)
373#if QT_DEPRECATED_SINCE(6, 2)
383 int fingerCount()
const {
return m_fingerCount; }
386#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
387 return m_delta.toPointF();
393#if QT_DEPRECATED_SINCE(6, 0)
394#ifndef QT_NO_INTEGER_EVENT_COORDINATES
398 inline const
QPoint globalPos()
const {
return globalPosition().toPoint(); }
403 QPointF windowPos()
const {
return scenePosition(); }
405 QPointF screenPos()
const {
return globalPosition(); }
410#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
433 int key()
const {
return m_key; }
434#if QT_CONFIG(shortcut)
444 inline int count()
const {
return int(m_count); }
450#if QT_CONFIG(shortcut)
519#if QT_DEPRECATED_SINCE(6, 0)
521 inline const QRegion ®ion()
const {
return m_region; }
535 SurfaceAboutToBeDestroyed
591#ifndef QT_NO_CONTEXTMENU
600#if QT_DEPRECATED_SINCE(6, 4)
605 inline int x()
const {
return m_pos.x(); }
606 inline int y()
const {
return m_pos.y(); }
607 inline int globalX()
const {
return m_globalPos.x(); }
608 inline int globalY()
const {
return m_globalPos.y(); }
622#ifndef QT_NO_INPUTMETHOD
647 void setCommitString(
const QString &commitString,
int replaceFrom = 0,
int replaceLength = 0);
665 return !(lhs == rhs);
672 int m_replacementStart;
673 int m_replacementLength;
683 Qt::InputMethodQueries
queries()
const {
return m_queries; }
688 Qt::InputMethodQueries m_queries;
700#if QT_CONFIG(draganddrop)
704class Q_GUI_EXPORT QDropEvent :
public QEvent
711#if QT_DEPRECATED_SINCE(6, 0)
717 inline
Qt::MouseButtons mouseButtons()
const {
return buttons(); }
719 inline
Qt::KeyboardModifiers keyboardModifiers()
const {
return modifiers(); }
723 inline Qt::MouseButtons buttons()
const {
return m_mouseState; }
724 inline Qt::KeyboardModifiers
modifiers()
const {
return m_modState; }
726 inline Qt::DropActions possibleActions()
const {
return m_actions; }
727 inline Qt::DropAction proposedAction()
const {
return m_defaultAction; }
728 inline void acceptProposedAction() { m_dropAction = m_defaultAction;
accept(); }
739 Qt::MouseButtons m_mouseState;
740 Qt::KeyboardModifiers m_modState;
741 Qt::DropActions m_actions;
748class Q_GUI_EXPORT QDragMoveEvent :
public QDropEvent
753 Qt::MouseButtons buttons, Qt::KeyboardModifiers
modifiers,
Type type = DragMove);
755 inline QRect answerRect()
const {
return m_rect; }
757 inline void accept() { QDropEvent::accept(); }
758 inline void ignore() { QDropEvent::ignore(); }
768class Q_GUI_EXPORT QDragEnterEvent :
public QDragMoveEvent
773 Qt::MouseButtons buttons, Qt::KeyboardModifiers
modifiers);
777class Q_GUI_EXPORT QDragLeaveEvent :
public QEvent
792 inline int x()
const {
return m_pos.x(); }
793 inline int y()
const {
return m_pos.y(); }
794 inline int globalX()
const {
return m_globalPos.x(); }
795 inline int globalY()
const {
return m_globalPos.y(); }
805#ifndef QT_NO_STATUSTIP
818#if QT_CONFIG(whatsthis)
819class Q_GUI_EXPORT QWhatsThisClickedEvent :
public QEvent
823 explicit QWhatsThisClickedEvent(
const QString &href);
825 inline QString href()
const {
return m_href; }
838 inline QAction *action()
const {
return m_action; }
839 inline QAction *before()
const {
return m_before; }
855#if QT_DEPRECATED_SINCE(6, 6)
871 inline bool toggle()
const {
return m_toggle; }
877#if QT_CONFIG(shortcut)
888 inline int shortcutId()
const {
return m_shortcutId; }
889 inline bool isAmbiguous()
const {
return m_ambiguous; }
903 inline Qt::WindowStates
oldState()
const {
return m_oldStates; }
904 bool isOverride()
const;
907 Qt::WindowStates m_oldStates;
911#ifndef QT_NO_DEBUG_STREAM
925#if QT_DEPRECATED_SINCE(6, 0)
936#if QT_DEPRECATED_SINCE(6, 0)
940 bool isBeginEvent()
const override;
941 bool isUpdateEvent()
const override;
942 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.
The QCloseEvent class contains parameters that describe a close event.
The QEventPoint class provides information about a point in a QPointerEvent.
virtual void setAccepted(bool accepted)
Type
This enum type defines the valid event types in Qt.
Type type() const
Returns the event type.
void ignore()
Clears the accept flag parameter of the event object, the equivalent of calling setAccepted(false).
void accept()
Sets the accept flag of the event object, the equivalent of calling setAccepted(true).
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.
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 bool openFile(const QString &fileName, QFile &file)
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]