C++ (Qt)qobject_cast< MainWindow* >( MyWidget->window() )->tvar
QDockWidget *dock = new QDockWidget(tr("MyDock"), this); myWidget = new QmyWidget(dock); dock->setWidget(myWidget); addDockWidget(Qt::LeftDockWidgetArea, dock); connect(myWidget, SIGNAL(destroyed()), myGlobal, SLOT(myWidgetClose()));
QDockWidget *dock = new QDockWidget(tr("MyDock"), this);dock->setAttribute(Qt::WA_DeleteOnClose);