summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNorwegian Rock Cat <qt-info@nokia.com>2009-05-13 13:34:34 (GMT)
committerNorwegian Rock Cat <qt-info@nokia.com>2009-05-13 13:34:34 (GMT)
commit9820412d2551b655fec24ffde7b2a56e3ad168ea (patch)
tree54b79c77980994721e2f88a3f82c0380773def8a
parent0a74bc2ce91e8c7a10ae54fd0f80814902fa5de9 (diff)
downloadQt-9820412d2551b655fec24ffde7b2a56e3ad168ea.zip
Qt-9820412d2551b655fec24ffde7b2a56e3ad168ea.tar.gz
Qt-9820412d2551b655fec24ffde7b2a56e3ad168ea.tar.bz2
Ensure that sheets are hidden if the parents are hidden in Carbon.
Seems to work correctly in Cocoa, but we need to handle this special case in Carbon ourselves. Task-number: 253324 Reviewed-by: Richard Moe Gustavsen
-rw-r--r--src/gui/kernel/qwidget_mac.mm14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm
index 6d3da61..6524bc9 100644
--- a/src/gui/kernel/qwidget_mac.mm
+++ b/src/gui/kernel/qwidget_mac.mm
@@ -728,6 +728,7 @@ static OSWindowRef qt_mac_create_window(QWidget *, WindowClass wclass, WindowAtt
static EventTypeSpec window_events[] = {
{ kEventClassWindow, kEventWindowClose },
{ kEventClassWindow, kEventWindowExpanded },
+ { kEventClassWindow, kEventWindowHidden },
{ kEventClassWindow, kEventWindowZoomed },
{ kEventClassWindow, kEventWindowCollapsed },
{ kEventClassWindow, kEventWindowToolbarSwitchMode },
@@ -997,6 +998,19 @@ OSStatus QWidgetPrivate::qt_window_event(EventHandlerCallRef er, EventRef event,
}
}
}
+ } else if (ekind == kEventWindowHidden) {
+ // Make sure that we also hide any visible sheets on our window.
+ // Cocoa does the right thing for us.
+ const QObjectList children = widget->children();
+ const int childCount = children.count();
+ for (int i = 0; i < childCount; ++i) {
+ QObject *obj = children.at(i);
+ if (obj->isWidgetType()) {
+ QWidget *widget = static_cast<QWidget *>(obj);
+ if (qt_mac_is_macsheet(widget) && widget->isVisible())
+ widget->hide();
+ }
+ }
} else {
handled_event = false;
}