summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp')
-rw-r--r--tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp b/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp
index 5bd26c632c..6ee5f76c6a 100644
--- a/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp
+++ b/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp
@@ -859,6 +859,10 @@ void tst_QMainWindow::takeCentralWidget() {
QVERIFY(!mw.centralWidget());
+ // verify that we don't crash when trying to take a non-set
+ // central widget but just return a null pointer instead
+ QVERIFY(!mw.takeCentralWidget());
+
mw.setCentralWidget(w1);
QWidget *oldCentralWidget = mw.takeCentralWidget();