summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qwidget_mac.mm
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel/qwidget_mac.mm')
-rw-r--r--src/gui/kernel/qwidget_mac.mm9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm
index 1979c84..159c45d 100644
--- a/src/gui/kernel/qwidget_mac.mm
+++ b/src/gui/kernel/qwidget_mac.mm
@@ -2375,7 +2375,8 @@ void QWidgetPrivate::recreateMacWindow()
HIViewRemoveFromSuperview(myView);
determineWindowClass();
createWindow_sys();
- if (QMainWindowLayout *mwl = qobject_cast<QMainWindowLayout *>(q->layout())) {
+
+ if (QMainWindowLayout *mwl = qt_mainwindow_layout(qobject_cast<QMainWindow *>(q))) {
mwl->updateHIToolBarStatus();
}
@@ -2912,7 +2913,7 @@ void QWidgetPrivate::setParent_sys(QWidget *parent, Qt::WindowFlags f)
// We do this down below for wasCreated, so avoid doing this twice
// (only for performance, it gets called a lot anyway).
if (!wasCreated) {
- if (QMainWindowLayout *mwl = qobject_cast<QMainWindowLayout *>(q->layout())) {
+ if (QMainWindowLayout *mwl = qt_mainwindow_layout(qobject_cast<QMainWindow *>(q))) {
mwl->updateHIToolBarStatus();
}
}
@@ -2937,7 +2938,7 @@ void QWidgetPrivate::setParent_sys(QWidget *parent, Qt::WindowFlags f)
// If we were a unified window, We just transfered our toolbars out of the unified toolbar.
// So redo the status one more time. It apparently is not an issue with Cocoa.
if (q->isWindow()) {
- if (QMainWindowLayout *mwl = qobject_cast<QMainWindowLayout *>(q->layout())) {
+ if (QMainWindowLayout *mwl = qt_mainwindow_layout(qobject_cast<QMainWindow *>(q))) {
mwl->updateHIToolBarStatus();
}
}
@@ -5138,7 +5139,7 @@ void QWidgetPrivate::macUpdateMetalAttribute()
return;
recreateMacWindow();
#else
- QMainWindowLayout *layout = qobject_cast<QMainWindowLayout *>(q->layout());
+ QMainWindowLayout *layout = qt_mainwindow_layout(qobject_cast<QMainWindow *>(q));
if (q->testAttribute(Qt::WA_MacBrushedMetal)) {
if (layout)
layout->updateHIToolBarStatus();