diff options
author | Harald Fernengel <harald.fernengel@nokia.com> | 2010-10-20 11:31:27 (GMT) |
---|---|---|
committer | Harald Fernengel <harald.fernengel@nokia.com> | 2010-10-20 11:31:27 (GMT) |
commit | 98b931a841f284051a2e22de412701bd2c4f4a76 (patch) | |
tree | 67e80613bff14bfd7a3c5e0f77afea8aba6ba81c | |
parent | 05a0b538e44902505ef0aed434b1dca52439a40a (diff) | |
download | Qt-98b931a841f284051a2e22de412701bd2c4f4a76.zip Qt-98b931a841f284051a2e22de412701bd2c4f4a76.tar.gz Qt-98b931a841f284051a2e22de412701bd2c4f4a76.tar.bz2 |
Fix autotest failure with experimental client deco
The menu bar is in the outer layout, not the inner one
-rw-r--r-- | src/gui/widgets/qmainwindow.cpp | 2 | ||||
-rw-r--r-- | tests/auto/qmainwindow/tst_qmainwindow.cpp | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/gui/widgets/qmainwindow.cpp b/src/gui/widgets/qmainwindow.cpp index d971f61..2731182 100644 --- a/src/gui/widgets/qmainwindow.cpp +++ b/src/gui/widgets/qmainwindow.cpp @@ -504,7 +504,7 @@ void QMainWindow::setToolButtonStyle(Qt::ToolButtonStyle toolButtonStyle) */ QMenuBar *QMainWindow::menuBar() const { - QMenuBar *menuBar = qobject_cast<QMenuBar *>(d_func()->layout->menuBar()); + QMenuBar *menuBar = qobject_cast<QMenuBar *>(layout()->menuBar()); if (!menuBar) { QMainWindow *self = const_cast<QMainWindow *>(this); menuBar = new QMenuBar(self); diff --git a/tests/auto/qmainwindow/tst_qmainwindow.cpp b/tests/auto/qmainwindow/tst_qmainwindow.cpp index e427863..c82c566 100644 --- a/tests/auto/qmainwindow/tst_qmainwindow.cpp +++ b/tests/auto/qmainwindow/tst_qmainwindow.cpp @@ -701,10 +701,12 @@ void tst_QMainWindow::statusBar() // deleting the status bar should remove it from the main window QMainWindow mw; QStatusBar *sb = mw.statusBar(); - int indexOfSb = mw.layout()->indexOf(sb); + QMainWindowLayout *l = qFindChild<QMainWindowLayout *>(&mw); + QVERIFY(l); + int indexOfSb = l->indexOf(sb); QVERIFY(indexOfSb != -1); delete sb; - indexOfSb = mw.layout()->indexOf(sb); + indexOfSb = l->indexOf(sb); QVERIFY(indexOfSb == -1); } } |