C++ (Qt)Dialog *d = new Dialog;MyWidget *w = new MyWidget(d);
Dialog D;MyWidget My;My.setParent(&D);D.show();