Fix crash in QCococaWindow::childWindowAt().
Task-number: QTBUG-31297 Change-Id: I96f4652e410334fae54a0012ed917a965becfe5c Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>bb10
parent
c1ca272f04
commit
d2ec7e05eb
|
|
@ -1010,15 +1010,11 @@ void QCocoaWindow::obscureWindow()
|
|||
QWindow *QCocoaWindow::childWindowAt(QPoint windowPoint)
|
||||
{
|
||||
QWindow *targetWindow = window();
|
||||
foreach (QObject *child, targetWindow->children()) {
|
||||
if (QWindow *childWindow = qobject_cast<QWindow *>(child)) {
|
||||
if (childWindow->geometry().contains(windowPoint)) {
|
||||
QCocoaWindow* platformWindow = static_cast<QCocoaWindow*>(childWindow->handle());
|
||||
if (platformWindow->isExposed())
|
||||
targetWindow = platformWindow->childWindowAt(windowPoint - childWindow->position());
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach (QObject *child, targetWindow->children())
|
||||
if (QWindow *childWindow = qobject_cast<QWindow *>(child))
|
||||
if (QPlatformWindow *handle = childWindow->handle())
|
||||
if (handle->isExposed() && childWindow->geometry().contains(windowPoint))
|
||||
targetWindow = static_cast<QCocoaWindow*>(handle)->childWindowAt(windowPoint - childWindow->position());
|
||||
|
||||
return targetWindow;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue