summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/widgets/qopenglwidget
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-07-04 15:19:36 +0200
committerLiang Qi <liang.qi@qt.io>2017-07-04 16:05:53 +0200
commitc2b224a758ce7e6dcf3748444fa8e29ab81904be (patch)
tree277cb99bf054190c935579142506caa4ec9861dd /tests/auto/widgets/widgets/qopenglwidget
parent10de063ff12cdba07b4620182aced8ed05ee3505 (diff)
parenteaee1209f0ead5be786e81db8aee604ccfea85b0 (diff)
Merge remote-tracking branch 'origin/5.9' into dev
Conflicts: src/corelib/io/qprocess_unix.cpp src/plugins/platforms/xcb/qxcbconnection.cpp src/plugins/platforms/xcb/qxcbwindow.cpp src/widgets/util/util.pri tests/auto/corelib/thread/qthread/qthread.pro tests/auto/corelib/thread/qthread/tst_qthread.cpp Change-Id: I5c45ab54d46d3c75a5c6c116777ebf5bc47a871b
Diffstat (limited to 'tests/auto/widgets/widgets/qopenglwidget')
-rw-r--r--tests/auto/widgets/widgets/qopenglwidget/BLACKLIST1
-rw-r--r--tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp31
2 files changed, 32 insertions, 0 deletions
diff --git a/tests/auto/widgets/widgets/qopenglwidget/BLACKLIST b/tests/auto/widgets/widgets/qopenglwidget/BLACKLIST
index fa326a6ea5..7825c33a0a 100644
--- a/tests/auto/widgets/widgets/qopenglwidget/BLACKLIST
+++ b/tests/auto/widgets/widgets/qopenglwidget/BLACKLIST
@@ -1,5 +1,6 @@
[clearAndGrab]
opensuse-13.1
+ubuntu
#QTBUG-31611
[painter]
diff --git a/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp b/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp
index 009a607818..e10c7591d5 100644
--- a/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp
+++ b/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp
@@ -55,6 +55,7 @@ private slots:
void painter();
void reparentToAlreadyCreated();
void reparentToNotYetCreated();
+ void reparentHidden();
void asViewport();
void requestUpdate();
void fboRedirect();
@@ -283,6 +284,36 @@ void tst_QOpenGLWidget::reparentToNotYetCreated()
QVERIFY(image.pixel(20, 10) == qRgb(0, 0, 255));
}
+void tst_QOpenGLWidget::reparentHidden()
+{
+ // Tests QTBUG-60896
+ QWidget topLevel1;
+
+ QWidget *container = new QWidget(&topLevel1);
+ PainterWidget *glw = new PainterWidget(container);
+ topLevel1.resize(640, 480);
+ glw->resize(320, 200);
+ topLevel1.show();
+
+ glw->hide(); // Explicitly hidden
+
+ QTest::qWaitForWindowExposed(&topLevel1);
+
+ QWidget topLevel2;
+ topLevel2.resize(640, 480);
+ topLevel2.show();
+ QTest::qWaitForWindowExposed(&topLevel2);
+
+ QOpenGLContext *originalContext = glw->context();
+ QVERIFY(originalContext);
+
+ container->setParent(&topLevel2);
+ glw->show(); // Should get a new context now
+
+ QOpenGLContext *newContext = glw->context();
+ QVERIFY(originalContext != newContext);
+}
+
class CountingGraphicsView : public QGraphicsView
{
public: