Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 7

Qt-interest Archive, March 2007
QMdiSubWindow


Message 1 in thread

Friends,I have an application in MDI and the new version of the QT (4.3.0)
will start to use new class, as QMdiArea and QMdiSubWindow.To place a window inside of the workspace a special window is created that
controls the embebed content. However in some tests the slot “close( )”
of the button eliminates the content all, but not destroy the window
that controls (QMdiSubWindow).In
the embebed Window I fixed the dimensions, however this does not
function in activity with QMdiSubWindow. Its follow part of the code:AlterPass *MainWindow::createAlterPass( ){    AlterPass *win = new AlterPass;        QMdiSubWindow *currentWindow = new QMdiSubWindow;    currentWindow->setWidget(win);    currentWindow->setAttribute(Qt::WA_DeleteOnClose);    mdiArea->addSubWindow(currentWindow);    currentWindow->show();}Thanks,Marcelo Estanislau.
_________________________________________________________________
Busque em qualquer página da Web com alta proteção. Obtenha o Windows Live Toolbar GRATUITO ainda hoje!
http://toolbar.live.com/

Message 2 in thread

Hi Marcelo,

> I have an application in MDI and the new version of the QT (4.3.0) will 
> start to use new class, as QMdiArea and QMdiSubWindow.
> To place a window inside of the workspace a special window is created 
> that controls the embebed content. However in some tests the slot 
> “close( )” of the button eliminates the content all, but not destroy the 
> window that controls (QMdiSubWindow).

This behavior is the same for all widgets in Qt. Deleting a child widget 
will not delete its parent widget, closing a child widget will not close 
its parent widget etc.

Use QMdiSubWindow::close if you want to close the sub-window itself.


-- 
 [ signature omitted ] 

Message 3 in thread

> From: bnilsen@xxxxxxxxxxxxx> Subject: Re: QMdiSubWindow> Date: Wed, 28 Mar 2007 09:43:53 +0200> To: estanisgeyer@xxxxxxxxxxx> To: qt-interest@xxxxxxxxxxxxx> > Hi Marcelo,> > > I have an application in MDI and the new version of the QT (4.3.0) will > > start to use new class, as QMdiArea and QMdiSubWindow.> > To place a window inside of the workspace a special window is created > > that controls the embebed content. However in some tests the slot > > “close( )” of the button eliminates the content all, but not destroy the > > window that controls (QMdiSubWindow).> > This behavior is the same for all widgets in Qt. Deleting a child widget > will not delete its parent widget, closing a child widget will not close > its parent widget etc.> > Use QMdiSubWindow::close if you want to close the sub-window itself.Ok, Test some things but did not function here. How I can write of clear form this? I have MainWindow and AlterPass (drawn in Qt Designer).The problem is that I'm not obtaining to pass the control of the parent widget for inside of the child widget (AlterPass class), making possible to
close the parent widget.Follow part of the code:----- MainWindow.cpp -----AlterPass *MainWindow::createAlterPass( ){    AlterPass *win = new AlterPass;    QMdiSubWindow *currentWindow = new QMdiSubWindow;    currentWindow->setWidget(win);    currentWindow->setAttribute(Qt::WA_DeleteOnClose);    mdiArea->addSubWindow(currentWindow);    currentWindow->show();}---- End of MainWindow-------- AlterPass.cpp----AlterPass::AlterPass(QWidget *parent)    :QWidget(parent){    ui.setupUi(this);    move(0,0);}AlterPass::~AlterPass( ){  }void AlterPass::closeEvent(QCloseEvent *event){    event->accept();}---- End of AlterPass----Thanks,Marcelo EstanislauStandard Net Tecnologia e Informação.> -- > Bjoern Erik Nilsen - bnilsen at trolltech.com> Trolltech ASA - Sandakervn. 116, P.O. Box 4332 Nydalen, 0402 Oslo, Norway> > --> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with "unsubscribe" in the subject or the body.> List archive and information: http://lists.trolltech.com/qt-interest/> 
_________________________________________________________________
Descubra e experimente alguns novos serviços online no Windows Live Ideas
http://ideas.live.com