39 UserInputEvent = 0x100,
40 Close = UserInputEvent | 0x01,
41 GeometryChange = 0x02,
42 Enter = UserInputEvent | 0x03,
43 Leave = UserInputEvent | 0x04,
45 WindowStateChanged = 0x06,
46 Mouse = UserInputEvent | 0x07,
47 Wheel = UserInputEvent | 0x09,
48 Key = UserInputEvent | 0x0a,
49 Touch = UserInputEvent | 0x0b,
50 ScreenOrientation = 0x0c,
51 ScreenGeometry = 0x0d,
52 ScreenAvailableGeometry = 0x0e,
53 ScreenLogicalDotsPerInch = 0x0f,
54 ScreenRefreshRate = 0x10,
57 FileOpen = UserInputEvent | 0x13,
58 Tablet = UserInputEvent | 0x14,
59 TabletEnterProximity = UserInputEvent | 0x15,
60 TabletLeaveProximity = UserInputEvent | 0x16,
61 PlatformPanel = UserInputEvent | 0x17,
62 ContextMenu = UserInputEvent | 0x18,
63 EnterWhatsThisMode = UserInputEvent | 0x19,
65 Gesture = UserInputEvent | 0x1a,
67 ApplicationStateChanged = 0x19,
69 WindowScreenChanged = 0x21,
70 SafeAreaMarginsChanged = 0x22,
71 ApplicationTermination = 0x23,
73 WindowDevicePixelRatioChanged = 0x25,
364 class Q_GUI_EXPORT TabletEvent :
public PointerEvent {
367 static void handleTabletEvent(QWindow *w,
const QPointF &local,
const QPointF &global,
368 int device,
int pointerType, Qt::MouseButtons buttons, qreal pressure, qreal xTilt, qreal yTilt,
369 qreal tangentialPressure, qreal rotation, qreal z, qint64 uid,
370 Qt::KeyboardModifiers modifiers = Qt::NoModifier);
371 static void setPlatformSynthesizesMouse(
bool v);
373 TabletEvent(QWindow *w, ulong time,
const QPointF &local,
const QPointF &global,
374 const QPointingDevice *device, Qt::MouseButtons b, qreal pressure, qreal xTilt, qreal yTilt, qreal tpressure,
375 qreal rotation, qreal z, Qt::KeyboardModifiers mods)
376 : PointerEvent(w, time, Tablet, mods, device),
377 buttons(b), local(local), global(global),
378 pressure(pressure), xTilt(xTilt), yTilt(yTilt), tangentialPressure(tpressure),
379 rotation(rotation), z(z) { }
380 Qt::MouseButtons buttons;
386 qreal tangentialPressure = 0;
389 static bool platformSynthesizesMouse;
456 class WindowSystemEventList {
457 QList<WindowSystemEvent *> impl;
458 mutable QMutex mutex;
460 WindowSystemEventList() : impl(), mutex() {}
461 ~WindowSystemEventList() { clear(); }
464 {
const QMutexLocker locker(&mutex); qDeleteAll(impl); impl.clear(); }
465 void prepend(WindowSystemEvent *e)
466 {
const QMutexLocker locker(&mutex); impl.prepend(e); }
467 WindowSystemEvent *takeFirstOrReturnNull()
468 {
const QMutexLocker locker(&mutex);
return impl.empty() ?
nullptr : impl.takeFirst(); }
469 WindowSystemEvent *takeFirstNonUserInputOrReturnNull()
471 const QMutexLocker locker(&mutex);
472 for (
int i = 0; i < impl.size(); ++i)
473 if (!(impl.at(i)->type & QWindowSystemInterfacePrivate::UserInputEvent))
474 return impl.takeAt(i);
477 bool nonUserInputEventsQueued()
479 const QMutexLocker locker(&mutex);
480 for (
int i = 0; i < impl.size(); ++i)
481 if (!(impl.at(i)->type & QWindowSystemInterfacePrivate::UserInputEvent))
485 void append(WindowSystemEvent *e)
486 {
const QMutexLocker locker(&mutex); impl.append(e); }
487 qsizetype count()
const
488 {
const QMutexLocker locker(&mutex);
return impl.size(); }
489 WindowSystemEvent *peekAtFirstOfType(EventType t)
const
491 const QMutexLocker locker(&mutex);
492 for (
int i = 0; i < impl.size(); ++i) {
493 if (impl.at(i)->type == t)
498 void remove(
const WindowSystemEvent *e)
500 const QMutexLocker locker(&mutex);
501 for (
int i = 0; i < impl.size(); ++i) {
502 if (impl.at(i) == e) {
503 delete impl.takeAt(i);
509 Q_DISABLE_COPY_MOVE(WindowSystemEventList)
535 toNativeTouchPoints(
const EventPointList &pointList,
const QWindow *window)
537 QList<QWindowSystemInterface::TouchPoint> newList;
538 newList.reserve(pointList.size());
539 for (
const auto &point : pointList) {
540 newList.append(toNativeTouchPoint(point, window));