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,
int 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,
int 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;
389 static bool platformSynthesizesMouse;
448 class WindowSystemEventList {
449 QList<WindowSystemEvent *> impl;
450 mutable QMutex mutex;
452 WindowSystemEventList() : impl(), mutex() {}
453 ~WindowSystemEventList() { clear(); }
456 {
const QMutexLocker locker(&mutex); qDeleteAll(impl); impl.clear(); }
457 void prepend(WindowSystemEvent *e)
458 {
const QMutexLocker locker(&mutex); impl.prepend(e); }
459 WindowSystemEvent *takeFirstOrReturnNull()
460 {
const QMutexLocker locker(&mutex);
return impl.empty() ?
nullptr : impl.takeFirst(); }
461 WindowSystemEvent *takeFirstNonUserInputOrReturnNull()
463 const QMutexLocker locker(&mutex);
464 for (
int i = 0; i < impl.size(); ++i)
465 if (!(impl.at(i)->type & QWindowSystemInterfacePrivate::UserInputEvent))
466 return impl.takeAt(i);
469 bool nonUserInputEventsQueued()
471 const QMutexLocker locker(&mutex);
472 for (
int i = 0; i < impl.size(); ++i)
473 if (!(impl.at(i)->type & QWindowSystemInterfacePrivate::UserInputEvent))
477 void append(WindowSystemEvent *e)
478 {
const QMutexLocker locker(&mutex); impl.append(e); }
479 qsizetype count()
const
480 {
const QMutexLocker locker(&mutex);
return impl.size(); }
481 WindowSystemEvent *peekAtFirstOfType(EventType t)
const
483 const QMutexLocker locker(&mutex);
484 for (
int i = 0; i < impl.size(); ++i) {
485 if (impl.at(i)->type == t)
490 void remove(
const WindowSystemEvent *e)
492 const QMutexLocker locker(&mutex);
493 for (
int i = 0; i < impl.size(); ++i) {
494 if (impl.at(i) == e) {
495 delete impl.takeAt(i);
501 Q_DISABLE_COPY_MOVE(WindowSystemEventList)
527 toNativeTouchPoints(
const EventPointList &pointList,
const QWindow *window)
529 QList<QWindowSystemInterface::TouchPoint> newList;
530 newList.reserve(pointList.size());
531 for (
const auto &point : pointList) {
532 newList.append(toNativeTouchPoint(point, window));