[Qt-interest] display disconnected

Arnold Krille arnold at arnoldarts.de
Fri Jun 26 12:20:57 CEST 2009


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090626/4eb734ac/attachment.bin 


More information about the Qt-interest-old mailing list