[Qt-interest] display disconnected

Albert Sanchez ouferrat at gmail.com
Fri Jun 26 12:27:55 CEST 2009


Ok, thank you very much to both!

Albert


On Fri, Jun 26, 2009 at 12:20 PM, Arnold Krille <arnold at arnoldarts.de>wrote:

> On Friday 26 June 2009 12:04:20 Albert Sanchez wrote:
> > Will the program really abort or will the QApplication.exec() return with
> > value 1? If it is the first case, isn't there any way to retry to
> connect?
>
> Calling exit(1) is not the same as QApplication::exec() returning 1!
>
> In fact QApplication::exec() will never get called, because
> QApplication::QApplication() (ie. the constructor) itself fails to connect
> to
> X and will quit the app the semi-hard way by calling ::exit(1).
>
> If you want to know whether a X-connection is available or not (for example
> to
> start the gui or not), I think you have to either run a test-app before
> initializing your own stuff and Application. Or you have to check the
> evironment if DISPLAY is set and contains something usable. But even then
> it
> might be set to a wrong value or the X might not accept your connections
> (this
> can happen when DISPLAY points to a remote X but that doesn't except
> connections).
>
> Have fun,
>
> Arnold
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090626/c7eafcb2/attachment.html 


More information about the Qt-interest-old mailing list