[Qt-interest] QMainWindow close signal

Tiago Correia tiago at cnotinfor.pt
Wed Mar 25 14:28:21 CET 2009


A solution might be to use the a different method, instead of calling close
directly when clicking on the button. You could have a flag, that would
change when clicking on the close button. When using the cross the window
would just close.
By defining the virtual method closeEvent() you could either choose what to
do: close, minimize, exit application, ...

On Wed, Mar 25, 2009 at 1:17 PM, NARCISO, Rui <RUI.NARCISO at airbus.com>wrote:

>
> In the same line of question, how to detect that a window was closed by
> means of the small "cross" icon on the top left corner of the window
> contrarily to a clean close by means of a "quit" button ?
>
>
> -----Message d'origine-----
> De : qt-interest-bounces at trolltech.com
> [mailto:qt-interest-bounces at trolltech.com]De la part de Denton Vis
> Envoyé : mercredi 25 mars 2009 14:00
> À : qt-interest at trolltech.com
> Objet : Re: [Qt-interest] QMainWindow close signal
>
>
> Also, if you want to know when the last visible primary window in your app
> is closing, you could use:
> void QApplication::lastWindowClosed ()   [signal]
>
> http://doc.trolltech.com/4.5/qapplication.html#lastWindowClosed
>
>
> "Juan D Guzman" <lostinthecode at googlemail.com> wrote in message
> news:49C91AD9.4030603 at gmail.com...
> > I was wondering if there is a signal that I can hook into on the window
> > close event?  Or should I just put my code in the destructor for the
> > window?
> >
> > I looked into the QMainWindow docs and saw none.  I'm suspecting that
> > putting my code in the destructor will give me the same effect but coming
> > from C# i'm used to catching the close event.
> >
> > Cheers,
> >
> > JD
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
> This mail has originated outside your organization, either from an external
> partner or the Global Internet.
> Keep this in mind if you answer this message.
>
>
>
> The information in this e-mail is confidential. The contents may not be
> disclosed or used by anyone other then the addressee. Access to this e-mail
> by anyone else is unauthorised.
> If you are not the intended recipient, please notify Airbus immediately and
> delete this e-mail.
> Airbus cannot accept any responsibility for the accuracy or completeness of
> this e-mail as it has been sent over public networks. If you have any
> concerns over the content of this message or its Accuracy or Integrity,
> please contact Airbus immediately.
> All outgoing e-mails from Airbus are checked using regularly updated virus
> scanning software but you should take whatever measures you deem to be
> appropriate to ensure that this message and any attachments are virus free.
>
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>



-- 
Tiago Correia
chief technology officer

cnoti inovação & desenvolvimento – Aprendizagem enRiquecida pela Tecnologia
www.cnotinfor.pt
Telefone: +351 239 499 231

Subscreva gratuitamente a nossa Newsletter BICA – Boletim informativo de
Interactividade, Comunicação e Aprendizagem
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090325/4764bd30/attachment.html 


More information about the Qt-interest-old mailing list