diff --git a/tests/manual/qopenglwidget/openglwidget/main.cpp b/tests/manual/qopenglwidget/openglwidget/main.cpp index 3844ca3d0f..deb555019f 100644 --- a/tests/manual/qopenglwidget/openglwidget/main.cpp +++ b/tests/manual/qopenglwidget/openglwidget/main.cpp @@ -47,6 +47,7 @@ #include #include #include +#include #include class Tools : public QObject @@ -216,12 +217,28 @@ int main(int argc, char *argv[]) sw->setObjectName("MDI Sub-Window for tab widget"); sw->setWindowTitle("Tabs"); + QWidget *secondTLW = new QWidget(nullptr, Qt::Tool); + new QVBoxLayout(secondTLW); + secondTLW->show(); + TabWidgetResetter twr(tw); Tools t(&wnd, glw3, QVector() << glw << glw2 << glw3 << glw4); QObject::connect(&t, SIGNAL(aboutToShowGLWidgets()), &twr, SLOT(reset())); QMenu *toolsMenu = wnd.menuBar()->addMenu("&Tools"); toolsMenu->addAction("&Turn widgets (or some parent) into native", &t, SLOT(turnNative())); toolsMenu->addAction("&Hide/show all OpenGL widgets", &t, SLOT(hideShowAllGL())); + toolsMenu->addAction("Toggle tab widget parent", [tw, sw, secondTLW] { + QObject* parent = tw->parent(); + if (parent == secondTLW) + { + sw->setWidget(tw); + } + else + { + sw->setWidget(nullptr); + secondTLW->layout()->addWidget(tw); + } + }); QTimer compStatusDumpTimer; QObject::connect(&compStatusDumpTimer, SIGNAL(timeout()), &t, SLOT(dumpCompositingStatus()));