mirror of
https://github.com/crystalidea/qt-build-tools.git
synced 2024-11-22 19:00:04 +08:00
5.6.1 apply patch for https://bugreports.qt.io/browse/QTBUG-52023
This commit is contained in:
parent
5619775b7b
commit
5bea661715
@ -1658,8 +1658,12 @@ void QCocoaWindow::setWindowCursor(NSCursor *cursor)
|
||||
// Othervise, set the cursor if this window is under the mouse. In
|
||||
// this case QNSView::cursorUpdate will set the cursor as the pointer
|
||||
// moves.
|
||||
if (m_nsWindow && m_qtView) {
|
||||
[m_nsWindow invalidateCursorRectsForView : m_qtView];
|
||||
NSWindow *nsWindow = m_nsWindow;
|
||||
if (!nsWindow)
|
||||
nsWindow = [m_qtView nsWindow];
|
||||
|
||||
if (nsWindow && m_qtView) {
|
||||
[nsWindow invalidateCursorRectsForView : m_qtView];
|
||||
} else {
|
||||
if (m_windowUnderMouse)
|
||||
[cursor set];
|
||||
|
@ -140,6 +140,8 @@ Q_FORWARD_DECLARE_OBJC_CLASS(QT_MANGLE_NAMESPACE(QNSViewMouseMoveHelper));
|
||||
- (void)registerDragTypes;
|
||||
- (NSDragOperation)handleDrag:(id <NSDraggingInfo>)sender;
|
||||
|
||||
- (NSWindow *)nsWindow;
|
||||
|
||||
@end
|
||||
|
||||
QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSView);
|
||||
|
@ -931,7 +931,7 @@ QT_WARNING_POP
|
||||
{
|
||||
Q_UNUSED(theEvent)
|
||||
// Set the cursor manually if there is no NSWindow.
|
||||
if (!m_platformWindow->m_nsWindow && m_platformWindow->m_windowCursor)
|
||||
if (![self nsWindow] && m_platformWindow->m_windowCursor)
|
||||
[m_platformWindow->m_windowCursor set];
|
||||
else
|
||||
[super cursorUpdate:theEvent];
|
||||
@ -940,7 +940,7 @@ QT_WARNING_POP
|
||||
-(void)resetCursorRects
|
||||
{
|
||||
// Use the cursor rect API if there is a NSWindow
|
||||
if (m_platformWindow->m_nsWindow && m_platformWindow->m_windowCursor)
|
||||
if ([self nsWindow] && m_platformWindow->m_windowCursor)
|
||||
[self addCursorRect:[self visibleRect] cursor:m_platformWindow->m_windowCursor];
|
||||
}
|
||||
|
||||
@ -2092,4 +2092,24 @@ static QPoint mapWindowCoordinates(QWindow *source, QWindow *target, QPoint poin
|
||||
QWindowSystemInterface::handleMouseEvent(target, mapWindowCoordinates(m_window, target, qtWindowPoint), qtScreenPoint, m_buttons);
|
||||
}
|
||||
|
||||
- (NSWindow *)nsWindow
|
||||
{
|
||||
typedef QT_MANGLE_NAMESPACE(QNSView) QNSV;
|
||||
|
||||
NSWindow *win = m_platformWindow->m_nsWindow;
|
||||
NSView *parent = self.superview;
|
||||
while (!win) {
|
||||
if (![parent isKindOfClass:[QNSV class]])
|
||||
break;
|
||||
|
||||
QCocoaWindow *platformWindow = static_cast<QNSV *>(parent)->m_platformWindow;
|
||||
if (platformWindow)
|
||||
win = platformWindow->m_nsWindow;
|
||||
|
||||
parent = parent.superview;
|
||||
}
|
||||
|
||||
return win;
|
||||
}
|
||||
|
||||
@end
|
||||
|
Loading…
Reference in New Issue
Block a user