summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPrasanth Ullattil <prasanth.ullattil@nokia.com>2010-07-14 11:03:48 (GMT)
committerPrasanth Ullattil <prasanth.ullattil@nokia.com>2010-07-14 11:44:14 (GMT)
commit56e24c99ee7a1b5b127b93cbab98f88e008ec9b8 (patch)
tree1cac8e3cd150a5619566513dd1bbdf576d9f5be5
parent74d0482c1690211a20bdfc996aa0ad30fdb9bb28 (diff)
downloadQt-56e24c99ee7a1b5b127b93cbab98f88e008ec9b8.zip
Qt-56e24c99ee7a1b5b127b93cbab98f88e008ec9b8.tar.gz
Qt-56e24c99ee7a1b5b127b93cbab98f88e008ec9b8.tar.bz2
Crash while runnig tst_QMdiSubWindow::emittingOfSignals test on Cocoa
We were assuming that the native windows we create will always have a corresponding QWidget. This is not the case for qt_root_win. Reviewed-by: Carlos Duclos
-rw-r--r--src/gui/kernel/qcocoasharedwindowmethods_mac_p.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h b/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h
index 8652816..6795149 100644
--- a/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h
+++ b/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h
@@ -85,6 +85,8 @@ QT_END_NAMESPACE
- (BOOL)canBecomeKeyWindow
{
QWidget *widget = [self QT_MANGLE_NAMESPACE(qt_qwidget)];
+ if (!widget)
+ return NO; // This should happen only for qt_root_win
bool isToolTip = (widget->windowType() == Qt::ToolTip);
bool isPopup = (widget->windowType() == Qt::Popup);
@@ -94,6 +96,8 @@ QT_END_NAMESPACE
- (BOOL)canBecomeMainWindow
{
QWidget *widget = [self QT_MANGLE_NAMESPACE(qt_qwidget)];
+ if (!widget)
+ return NO; // This should happen only for qt_root_win
bool isToolTip = (widget->windowType() == Qt::ToolTip);
bool isPopup = (widget->windowType() == Qt::Popup);