summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp')
-rw-r--r--tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
index a7c3f86687..00350c3946 100644
--- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
+++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
@@ -243,6 +243,7 @@ private slots:
void winIdChangeEvent();
void persistentWinId();
void showNativeChild();
+ void closeAndShowNativeChild();
void closeAndShowWithNativeChild();
void transientParent();
void qobject_castInDestroyedSlot();
@@ -4776,6 +4777,25 @@ void tst_QWidget::showNativeChild()
QVERIFY(QTest::qWaitForWindowExposed(&topLevel));
}
+void tst_QWidget::closeAndShowNativeChild()
+{
+ QWidget topLevel;
+ QWidget *nativeChild = new QWidget;
+ nativeChild->winId();
+ nativeChild->setFixedSize(200, 200);
+
+ QHBoxLayout *layout = new QHBoxLayout;
+ layout->addWidget(nativeChild);
+ topLevel.setLayout(layout);
+
+ topLevel.show();
+ QVERIFY(!nativeChild->isHidden());
+ nativeChild->close();
+ QVERIFY(nativeChild->isHidden());
+ nativeChild->show();
+ QVERIFY(!nativeChild->isHidden());
+}
+
void tst_QWidget::closeAndShowWithNativeChild()
{
bool dontCreateNativeWidgetSiblings = QApplication::testAttribute(Qt::AA_DontCreateNativeWidgetSiblings);