PDA

View Full Version : How to restore removed widget from QMdiArea ?



remdex
7th August 2009, 20:54
Hi,

Simple question to witch i cannot find answer. I remove widget from QMdiArea and want that removed widget appear as separate window. But cannot understand how to do it. Part of class... It just removes widhet from mdiarea and tries to make it separate window. But it just not works... Should i pass something more? "this" in this function is just Widget.



void ChatWindow::separateWindowClicked()
{
if (this->mdiArea)
{
QMdiSubWindow *currentSub = this->mdiArea->activeSubWindow();
if (currentSub){
this->mdiArea->removeSubWindow(currentSub);

this->activateWindow();
this->setVisible(true);
this->show();
}
}
}

remdex
7th August 2009, 20:59
Nevermind... Just find out... :)



void ChatWindow::separateWindowClicked()
{
if (this->mdiArea)
{
QMdiSubWindow *currentSub = this->mdiArea->activeSubWindow();
if (currentSub){
this->mdiArea->removeSubWindow(currentSub);
currentSub->show();
}
}
}