9@implementation QNSView (Touch)
11- (
bool)shouldSendSingleTouch
13 if (!m_platformWindow)
18 return m_platformWindow->window()->inherits(
"QWidgetWindow");
21- (
void)touchesBeganWithEvent:(NSEvent *)event
23 if (!m_platformWindow)
26 const NSTimeInterval timestamp = [event timestamp];
27 const QList<QWindowSystemInterface::TouchPoint> points = QCocoaTouch::getCurrentTouchPointList(event, [self shouldSendSingleTouch]);
28 qCDebug(lcQpaTouch) <<
"touchesBeganWithEvent" << points <<
"from device" << Qt::hex << [event deviceID];
29 QWindowSystemInterface::handleTouchEvent<QWindowSystemInterface::SynchronousDelivery>(
30 m_platformWindow->window(), timestamp * 1000,
31 QCocoaTouch::getTouchDevice(QInputDevice::DeviceType::TouchPad, [event deviceID]),
35- (
void)touchesMovedWithEvent:(NSEvent *)event
37 if (!m_platformWindow)
40 const NSTimeInterval timestamp = [event timestamp];
42 QCocoaDrag* nativeDrag = QCocoaIntegration::instance()->drag();
43 nativeDrag->setLastInputEvent(event, self);
45 const QList<QWindowSystemInterface::TouchPoint> points = QCocoaTouch::getCurrentTouchPointList(event, [self shouldSendSingleTouch]);
46 qCDebug(lcQpaTouch) <<
"touchesMovedWithEvent" << points <<
"from device" << Qt::hex << [event deviceID];
47 QWindowSystemInterface::handleTouchEvent<QWindowSystemInterface::SynchronousDelivery>(
48 m_platformWindow->window(), timestamp * 1000,
49 QCocoaTouch::getTouchDevice(QInputDevice::DeviceType::TouchPad, [event deviceID]),
53- (
void)touchesEndedWithEvent:(NSEvent *)event
55 if (!m_platformWindow)
58 const NSTimeInterval timestamp = [event timestamp];
60 QCocoaDrag* nativeDrag = QCocoaIntegration::instance()->drag();
61 nativeDrag->setLastInputEvent(event, self);
63 const QList<QWindowSystemInterface::TouchPoint> points = QCocoaTouch::getCurrentTouchPointList(event, [self shouldSendSingleTouch]);
64 qCDebug(lcQpaTouch) <<
"touchesEndedWithEvent" << points <<
"from device" << Qt::hex << [event deviceID];
65 QWindowSystemInterface::handleTouchEvent<QWindowSystemInterface::SynchronousDelivery>(
66 m_platformWindow->window(), timestamp * 1000,
67 QCocoaTouch::getTouchDevice(QInputDevice::DeviceType::TouchPad, [event deviceID]),
71- (
void)touchesCancelledWithEvent:(NSEvent *)event
73 if (!m_platformWindow)
76 const NSTimeInterval timestamp = [event timestamp];
78 QCocoaDrag* nativeDrag = QCocoaIntegration::instance()->drag();
79 nativeDrag->setLastInputEvent(event, self);
81 const QList<QWindowSystemInterface::TouchPoint> points = QCocoaTouch::getCurrentTouchPointList(event, [self shouldSendSingleTouch]);
82 qCDebug(lcQpaTouch) <<
"touchesCancelledWithEvent" << points <<
"from device" << Qt::hex << [event deviceID];
83 QWindowSystemInterface::handleTouchEvent<QWindowSystemInterface::SynchronousDelivery>(
84 m_platformWindow->window(), timestamp * 1000,
85 QCocoaTouch::getTouchDevice(QInputDevice::DeviceType::TouchPad, [event deviceID]),
Q_STATIC_LOGGING_CATEGORY(lcAccessibilityCore, "qt.accessibility.core")