Cocoa: Make tool window receive mouse events also when its parent is modal

We need to check for the Cocoa window class because of the way
currently QDockWidget works.

Change-Id: If69c7327c168518614fe884defa79deb358e260d
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
This commit is contained in:
Gabriel de Dietrich 2013-02-06 16:29:58 +01:00 committed by The Qt Project
parent e7a242b27b
commit 2be39c6832

View File

@ -301,9 +301,11 @@ void QCocoaWindow::setVisible(bool visible)
[m_nsWindow orderFront: nil];
}
// We want the events to properly reach the popup and dialog
if (window()->type() == Qt::Popup || window()->type() == Qt::Dialog)
// We want the events to properly reach the popup, dialog, and tool
if ((window()->type() == Qt::Popup || window()->type() == Qt::Dialog || window()->type() == Qt::Tool)
&& [m_nsWindow isKindOfClass:[NSPanel class]]) {
[(NSPanel *)m_nsWindow setWorksWhenModal:YES];
}
}
} else {
[m_contentView setHidden:NO];