summaryrefslogtreecommitdiffstats
path: root/tests/auto/qmainwindow/tst_qmainwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qmainwindow/tst_qmainwindow.cpp')
-rw-r--r--tests/auto/qmainwindow/tst_qmainwindow.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/auto/qmainwindow/tst_qmainwindow.cpp b/tests/auto/qmainwindow/tst_qmainwindow.cpp
index e118c65..9156e5e 100644
--- a/tests/auto/qmainwindow/tst_qmainwindow.cpp
+++ b/tests/auto/qmainwindow/tst_qmainwindow.cpp
@@ -106,6 +106,7 @@ private slots:
void isSeparator();
void setCursor();
void addToolbarAfterShow();
+ void centralWidgetSize();
};
// Testing get/set functions
@@ -1336,6 +1337,19 @@ public:
}
};
+class MyWidget : public QWidget
+{
+public:
+ MyWidget(QWidget *parent = 0) : QWidget(parent)
+ {
+ }
+
+ QSize sizeHint() const
+ {
+ return QSize(200, 200);
+ }
+};
+
void tst_QMainWindow::hideBeforeLayout()
{
QMainWindow win;
@@ -1650,6 +1664,18 @@ void tst_QMainWindow::addToolbarAfterShow()
QVERIFY(!toolBar.isHidden());
}
+void tst_QMainWindow::centralWidgetSize()
+{
+ QMainWindow mainWindow;
+ mainWindow.menuBar()->addMenu("menu");
+
+ MyWidget widget;
+ mainWindow.setCentralWidget(&widget);
+
+ mainWindow.show();
+ QTest::qWait(100);
+ QCOMPARE(widget.size(), widget.sizeHint());
+}
QTEST_MAIN(tst_QMainWindow)