Hi,

I have a window, then I create a new window and want to show it within the first window(with showing title window/minimize window, and it should be movable only within the first window). But set parent does not work.

Qt Code:
  1. QQmlApplicationEngine engine;
  2. QQmlComponent component(&engine, QUrl("qrc:/main.qml"));
  3.  
  4. QObject *m_visual = component.create();
  5. QQuickWindow *window = (QQuickWindow *)m_visual;
  6.  
  7.  
  8.  
  9. QQmlApplicationEngine engine_sub;
  10. QQmlComponent component_sub(&engine_sub, QUrl("qrc:/window2.qml"));
  11.  
  12. QObject *m_visual_sub = component_sub.create();
  13.  
  14.  
  15.  
  16. QQuickWindow *window_sub = (QQuickWindow *)m_visual_sub;
  17. m_visual_sub->setParent(m_visual);
  18. ((QQuickItem *)m_visual_sub)->setParentItem(window->contentItem());
To copy to clipboard, switch view to plain text mode 


Thank you so much!