diff options
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qwidget_mac.mm | 8 | ||||
-rw-r--r-- | src/gui/kernel/qwidget_win.cpp | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index a9bb691..e57ec77 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -2861,9 +2861,11 @@ void QWidgetPrivate::setParent_sys(QWidget *parent, Qt::WindowFlags f) } if (wasWindow) { oldToolbar = [oldWindow toolbar]; - [oldToolbar retain]; - oldToolbarVisible = [oldToolbar isVisible]; - [oldWindow setToolbar:nil]; + if (oldToolbar) { + [oldToolbar retain]; + oldToolbarVisible = [oldToolbar isVisible]; + [oldWindow setToolbar:nil]; + } } #endif } diff --git a/src/gui/kernel/qwidget_win.cpp b/src/gui/kernel/qwidget_win.cpp index 9c65aa0..0f05c6b 100644 --- a/src/gui/kernel/qwidget_win.cpp +++ b/src/gui/kernel/qwidget_win.cpp @@ -1167,7 +1167,7 @@ void QWidgetPrivate::show_sys() // This is to resolve the problem where popups are opened from the // system tray and not being implicitly activated if (q->windowType() == Qt::Popup && - (!q->parentWidget() || !q->parentWidget()->isActiveWindow())) + !q->parentWidget() && !qApp->activeWindow()) q->activateWindow(); } |