38 UserInputEvent = 0x100,
39 Close = UserInputEvent | 0x01,
40 GeometryChange = 0x02,
41 Enter = UserInputEvent | 0x03,
42 Leave = UserInputEvent | 0x04,
44 WindowStateChanged = 0x06,
45 Mouse = UserInputEvent | 0x07,
46 Wheel = UserInputEvent | 0x09,
47 Key = UserInputEvent | 0x0a,
48 Touch = UserInputEvent | 0x0b,
49 ScreenOrientation = 0x0c,
50 ScreenGeometry = 0x0d,
51 ScreenAvailableGeometry = 0x0e,
52 ScreenLogicalDotsPerInch = 0x0f,
53 ScreenRefreshRate = 0x10,
56 FileOpen = UserInputEvent | 0x13,
57 Tablet = UserInputEvent | 0x14,
58 TabletEnterProximity = UserInputEvent | 0x15,
59 TabletLeaveProximity = UserInputEvent | 0x16,
60 PlatformPanel = UserInputEvent | 0x17,
61 ContextMenu = UserInputEvent | 0x18,
62 EnterWhatsThisMode = UserInputEvent | 0x19,
64 Gesture = UserInputEvent | 0x1a,
66 ApplicationStateChanged = 0x19,
68 WindowScreenChanged = 0x21,
69 SafeAreaMarginsChanged = 0x22,
70 ApplicationTermination = 0x23,
72 WindowDevicePixelRatioChanged = 0x25,
363 class Q_GUI_EXPORT TabletEvent :
public PointerEvent {
366 static void handleTabletEvent(QWindow *w,
const QPointF &local,
const QPointF &global,
367 int device,
int pointerType, Qt::MouseButtons buttons, qreal pressure, qreal xTilt, qreal yTilt,
368 qreal tangentialPressure, qreal rotation,
int z, qint64 uid,
369 Qt::KeyboardModifiers modifiers = Qt::NoModifier);
370 static void setPlatformSynthesizesMouse(
bool v);
372 TabletEvent(QWindow *w, ulong time,
const QPointF &local,
const QPointF &global,
373 const QPointingDevice *device, Qt::MouseButtons b, qreal pressure, qreal xTilt, qreal yTilt, qreal tpressure,
374 qreal rotation,
int z, Qt::KeyboardModifiers mods)
375 : PointerEvent(w, time, Tablet, mods, device),
376 buttons(b), local(local), global(global),
377 pressure(pressure), xTilt(xTilt), yTilt(yTilt), tangentialPressure(tpressure),
378 rotation(rotation), z(z) { }
379 Qt::MouseButtons buttons;
385 qreal tangentialPressure;
388 static bool platformSynthesizesMouse;
447 class WindowSystemEventList {
448 QList<WindowSystemEvent *> impl;
449 mutable QMutex mutex;
451 WindowSystemEventList() : impl(), mutex() {}
452 ~WindowSystemEventList() { clear(); }
455 {
const QMutexLocker locker(&mutex); qDeleteAll(impl); impl.clear(); }
456 void prepend(WindowSystemEvent *e)
457 {
const QMutexLocker locker(&mutex); impl.prepend(e); }
458 WindowSystemEvent *takeFirstOrReturnNull()
459 {
const QMutexLocker locker(&mutex);
return impl.empty() ?
nullptr : impl.takeFirst(); }
460 WindowSystemEvent *takeFirstNonUserInputOrReturnNull()
462 const QMutexLocker locker(&mutex);
463 for (
int i = 0; i < impl.size(); ++i)
464 if (!(impl.at(i)->type & QWindowSystemInterfacePrivate::UserInputEvent))
465 return impl.takeAt(i);
468 bool nonUserInputEventsQueued()
470 const QMutexLocker locker(&mutex);
471 for (
int i = 0; i < impl.size(); ++i)
472 if (!(impl.at(i)->type & QWindowSystemInterfacePrivate::UserInputEvent))
476 void append(WindowSystemEvent *e)
477 {
const QMutexLocker locker(&mutex); impl.append(e); }
478 qsizetype count()
const
479 {
const QMutexLocker locker(&mutex);
return impl.size(); }
480 WindowSystemEvent *peekAtFirstOfType(EventType t)
const
482 const QMutexLocker locker(&mutex);
483 for (
int i = 0; i < impl.size(); ++i) {
484 if (impl.at(i)->type == t)
489 void remove(
const WindowSystemEvent *e)
491 const QMutexLocker locker(&mutex);
492 for (
int i = 0; i < impl.size(); ++i) {
493 if (impl.at(i) == e) {
494 delete impl.takeAt(i);
500 Q_DISABLE_COPY_MOVE(WindowSystemEventList)
526 toNativeTouchPoints(
const EventPointList &pointList,
const QWindow *window)
528 QList<QWindowSystemInterface::TouchPoint> newList;
529 newList.reserve(pointList.size());
530 for (
const auto &point : pointList) {
531 newList.append(toNativeTouchPoint(point, window));