[Qt-interest] Problem with aboutToClose signal

Mirko Viviani furetto76 at gmail.com
Tue Jan 19 14:13:33 CET 2010


It's a console application.
(I was mistyping: I intended aboutToQuit)

2010/1/19 Arnold Krille <arnold at arnoldarts.de>

> On Tuesday 19 January 2010 13:44:28 Mirko Viviani wrote:
> > Hi list!
> > I have a problem connecting the aboutToClose signal in my Windows core
> > application.
> > When hit the "X" button (close button) the slot myownclose is never
> >  executed (nor the aboutToClose signal emitted).
> >
> > Thanks to everybody!
> >
> > Here the (simplified) code:
> >
> > Class myHandler : QCoreApplication
> > { ....
> >   /*construtcor */
> >   myHandler(int *argc, char* argv[]) : QCoreApplication(argc, argv)
> >   {
> >       ....
> >       connect (this, SIGNAL(aboutToClose()), this, SLOT(myownclose());
> >   }
> >  /*slot*/
> > void myownclose()
> > {
> >    do something
> > }
> >
> > the main:
> > int main(int argc, char *argv[])
> >
> > {
> > myHandler mywindow(argc, argv);
> >
> >  mywindow server.exec();
> >
> > }
> >
>
> Probably your app is complaining at runtime that there is no aboutToClose
> signal with QCoreApplication. You mean aboutToQuit().
>
> If your app has windows (widgets), you shouldn't use plain
> QCoreApplication.
>
> If you are writing a console-app, hitting the 'X' symbol in the windows
> terminal will _not_ make you app quit, but it will kill your app directly.
> No
> aboutToQuit will be executed afaik.
>
> Arnold
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>


-- 
-- Cav. Dott. Mirko Viviani --
GPG-PGP Public Key: 0x3191CBBB
Fingerprint: 62BA 592D EC76 4C7B 9AE7 EB66 AB6A 9E0A 3191 CBBB
***********************************************
"“Machines take me by surprise with great frequency.” A. Turing
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100119/fe1388ce/attachment.html 


More information about the Qt-interest-old mailing list