41 UserInputEvent = 0x100,
42 Close = UserInputEvent | 0x01,
43 GeometryChange = 0x02,
44 Enter = UserInputEvent | 0x03,
45 Leave = UserInputEvent | 0x04,
47 WindowStateChanged = 0x06,
48 Mouse = UserInputEvent | 0x07,
49 Wheel = UserInputEvent | 0x09,
50 Key = UserInputEvent | 0x0a,
51 Touch = UserInputEvent | 0x0b,
52 ScreenOrientation = 0x0c,
53 ScreenGeometry = 0x0d,
54 ScreenAvailableGeometry = 0x0e,
55 ScreenLogicalDotsPerInch = 0x0f,
56 ScreenRefreshRate = 0x10,
59 FileOpen = UserInputEvent | 0x13,
60 Tablet = UserInputEvent | 0x14,
61 TabletEnterProximity = UserInputEvent | 0x15,
62 TabletLeaveProximity = UserInputEvent | 0x16,
63 PlatformPanel = UserInputEvent | 0x17,
64 ContextMenu = UserInputEvent | 0x18,
65 EnterWhatsThisMode = UserInputEvent | 0x19,
67 Gesture = UserInputEvent | 0x1a,
69 ApplicationStateChanged = 0x19,
71 WindowScreenChanged = 0x21,
72 SafeAreaMarginsChanged = 0x22,
73 ApplicationTermination = 0x23,
75 WindowDevicePixelRatioChanged = 0x25,
367 class Q_GUI_EXPORT TabletEvent :
public PointerEvent {
370 static void handleTabletEvent(QWindow *w,
const QPointF &local,
const QPointF &global,
371 int device,
int pointerType, Qt::MouseButtons buttons, qreal pressure, qreal xTilt, qreal yTilt,
372 qreal tangentialPressure, qreal rotation, qreal z, qint64 uid,
373 Qt::KeyboardModifiers modifiers = Qt::NoModifier);
374 static void setPlatformSynthesizesMouse(
bool v);
376 TabletEvent(QWindow *w, ulong time,
const QPointF &local,
const QPointF &global,
377 const QPointingDevice *device, Qt::MouseButtons b, qreal pressure, qreal xTilt, qreal yTilt, qreal tpressure,
378 qreal rotation, qreal z, Qt::KeyboardModifiers mods)
379 : PointerEvent(w, time, Tablet, mods, device),
380 buttons(b), local(local), global(global),
381 pressure(pressure), xTilt(xTilt), yTilt(yTilt), tangentialPressure(tpressure),
382 rotation(rotation), z(z) { }
383 Qt::MouseButtons buttons;
389 qreal tangentialPressure = 0;
392 static bool platformSynthesizesMouse;
459 class WindowSystemEventList {
460 QList<WindowSystemEvent *> impl;
461 mutable QMutex mutex;
463 WindowSystemEventList() : impl(), mutex() {}
464 ~WindowSystemEventList() { clear(); }
467 {
const QMutexLocker locker(&mutex); qDeleteAll(impl); impl.clear(); }
468 void prepend(WindowSystemEvent *e)
469 {
const QMutexLocker locker(&mutex); impl.prepend(e); }
470 WindowSystemEvent *takeFirstOrReturnNull()
471 {
const QMutexLocker locker(&mutex);
return impl.empty() ?
nullptr : impl.takeFirst(); }
472 WindowSystemEvent *takeFirstNonUserInputOrReturnNull()
474 const QMutexLocker locker(&mutex);
475 for (
int i = 0; i < impl.size(); ++i)
476 if (!(impl.at(i)->type & QWindowSystemInterfacePrivate::UserInputEvent))
477 return impl.takeAt(i);
480 bool nonUserInputEventsQueued()
482 const QMutexLocker locker(&mutex);
483 for (
int i = 0; i < impl.size(); ++i)
484 if (!(impl.at(i)->type & QWindowSystemInterfacePrivate::UserInputEvent))
488 void append(WindowSystemEvent *e)
489 {
const QMutexLocker locker(&mutex); impl.append(e); }
490 qsizetype count()
const
491 {
const QMutexLocker locker(&mutex);
return impl.size(); }
492 WindowSystemEvent *peekAtFirstOfType(EventType t)
const
494 const QMutexLocker locker(&mutex);
495 for (
int i = 0; i < impl.size(); ++i) {
496 if (impl.at(i)->type == t)
501 void remove(
const WindowSystemEvent *e)
503 const QMutexLocker locker(&mutex);
504 for (
int i = 0; i < impl.size(); ++i) {
505 if (impl.at(i) == e) {
506 delete impl.takeAt(i);
512 Q_DISABLE_COPY_MOVE(WindowSystemEventList)
538 toNativeTouchPoints(
const EventPointList &pointList,
const QWindow *window)
540 QList<QWindowSystemInterface::TouchPoint> newList;
541 newList.reserve(pointList.size());
542 for (
const auto &point : pointList) {
543 newList.append(toNativeTouchPoint(point, window));