QCocoaWindow: Fix handleMouseEvent() compilation warning
qtbase/src/plugins/platforms/cocoa/qcocoawindow.mm:408:53: warning: 'handleMouseEvent<QWindowSystemInterface::DefaultDelivery>' is deprecated [-Wdeprecated-declarations] QWindowSystemInterface::handleMouseEvent(window(), window()->mapFromGlobal(localPoint.toPoint()), localPoint, Change-Id: Ifbf8c46e31a1de2089ce0e16cec087fdd9adb64e Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
This commit is contained in:
parent
309dacedac
commit
143cf9e467
@ -404,8 +404,10 @@ void QCocoaWindow::setVisible(bool visible)
|
||||
removeMonitor();
|
||||
monitor = [NSEvent addGlobalMonitorForEventsMatchingMask:NSLeftMouseDownMask|NSRightMouseDownMask|NSOtherMouseDownMask|NSMouseMovedMask handler:^(NSEvent *e) {
|
||||
QPointF localPoint = QCocoaScreen::mapFromNative([NSEvent mouseLocation]);
|
||||
const auto eventType = e.type == NSMouseMoved ? QEvent::MouseMove : QEvent::MouseButtonPress;
|
||||
QWindowSystemInterface::handleMouseEvent(window(), window()->mapFromGlobal(localPoint.toPoint()), localPoint,
|
||||
cocoaButton2QtButton([e buttonNumber]));
|
||||
Qt::MouseButtons(uint(NSEvent.pressedMouseButtons & 0xFFFF)),
|
||||
cocoaButton2QtButton(e.buttonNumber), eventType);
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user