I have the following code inside a method handleButton(), which gives me the qml ApplicationWindow inside a new window when handleButton() is triggered. But how can I place the content of the ApplicationWindow inside the C++ childwindow (shown with help of MyWidget)? For example, if I say mainLayout->addLayout(verticalLayout);
then there comes a white area inside the GroupBox in which handleButton is triggered. But I want to have this white area in the child window, and it must not be a white area: it must contain the qml ApplicationWindow. Any help appreciated.

Qt Code:
  1. void MyWidget::handleButton()
  2. {
  3.  
  4. QQuickView *view = new QQuickView();
  5. QWidget *container = QWidget::createWindowContainer(view, this);
  6. container->setMinimumSize(200, 200);
  7. container->setMaximumSize(200, 200);
  8. container->setFocusPolicy(Qt::TabFocus);
  9. view->setSource(QUrl("qrc:/main.qml"));
  10. QVBoxLayout *verticalLayout = new QVBoxLayout();
  11. verticalLayout->addWidget(container);
  12.  
  13. }
To copy to clipboard, switch view to plain text mode