#include #include #include int main(int argc, char *argv[]) { QApplication app(argc, argv); QWindow w1; w1.setGeometry(100, 100, 640, 400); w1.setTitle("Window 1"); auto w2 = new QWindow; w2->setGeometry(150, 150, 400, 400); w2->setTransientParent(&w1); w2->setTitle("Window 2"); auto w3 = new QWindow; w3->setGeometry(200, 200, 400, 400); w3->setTransientParent(w2); w3->setTitle("Window 3"); w1.show(); w2->show(); w3->show(); QTimer::singleShot(5000, w2, &QObject::deleteLater); return app.exec(); }