My first qt question: how can I convert a MDIsubwindow to popup windows back and forc
Hi all , I am new here.
What I want to do is:
I have a MDI app in page mode. I want user can select a page and change that window into popup window(parent as desktop) so he can drag it out side of MDI app window.
Also I want that popup window can be converted back to one page of MDI window.
Does anyone know how can I do this?
Thanks.
I am using QT 4.4.3
Re: My first qt question: how can I convert a MDIsubwindow to popup windows back and
Re: My first qt question: how can I convert a MDIsubwindow to popup windows back and
Tks.
It is kind of works.
I remove the QMdiSubWindow to another mdiarea in another qmainwindow.
Then before the new window close I addSubWindow it back to mdiarea again.
It works fine in Window but in MAC, it never come back. New tab added but when I click that tab nothing(just gray area) displayed. If I switch to another page this page's header just be gray out.
Any hint?
THanks again.
Re: My first qt question: how can I convert a MDIsubwindow to popup windows back and
Re: My first qt question: how can I convert a MDIsubwindow to popup windows back and
Sure.
When I need to move the MDIsubWindow to desktop:
Code:
QMdiArea *area = new QMdiArea();
QMdiSubWindow *subWin = this->mdiArea->activeSubWindow();
// I did try to remove this subwin from mdiArea first but not difference
area->addSubWindow(subWin);
XSubWindow *win = new XSubWindow();
win->setMdiArea(area);
win->show();
connect(win, SIGNAL(returnSubWindow(QMdiSubWindow*)), this, SLOT(getReturnedSubWindow(QMdiSubWindow*)));
XSubWindow is just a QMainWindow with
closeEvent like
Code:
{
emit returnSubWindow(this->mdiArea->activeSubWindow());
event->accept();
}
to handle the returnSubWindow in main MDI window:
Code:
void MainWindow::getReturnedSubWindow(QMdiSubWindow *rwin)
{
this->mdiArea->addSubWindow(rwin);
}
The content of MDIsubWindow is ether a WEBkit window:
Code:
XWebWidget *child = new XWebWidget;
child->setWindowTitle("Demo");
mdiArea->addSubWindow(child);
or
QGraphicsScene only contains a picture.
Code:
scene.setSceneRect(-300, -300, 600, 600);
view->setWindowTitle("Demo Bid Page");
view
->setRenderHint
(QPainter::Antialiasing);
view
->setBackgroundBrush
(QPixmap(":/images/demo.jpg"));
mdiArea->addSubWindow(view);
Re: My first qt question: how can I convert a MDIsubwindow to popup windows back and
Re: My first qt question: how can I convert a MDIsubwindow to popup windows back and
without looking at your code in too much detail:
probably your window does get closed after adding it to the other QMDiArea.
Try ignoring (or if that does not work: filtering) the close event.
HTH