[Qt-interest] qapplication constructor

Sean Harmer sean.harmer at maps-technology.com
Thu Jul 2 11:23:45 CEST 2009


On Thursday 02 Jul 2009 10:15:56 Albert Sanchez wrote:
> Does the QApplication constructor QApplication(argc,argv) check wether
> there is connection with the X display or not? 
Yes unless you use the constructor:

QApplication::QApplication ( int & argc, char ** argv, bool GUIenabled )

and pass GUIenabled = false. It's in the docs:

"On X11, the window system is initialized if GUIenabled is true. If GUIenabled 
is false, the application does not connect to the X server. On Windows and 
Macintosh, currently the window system is always initialized, regardless of 
the value of GUIenabled. This may change in future versions of Qt."

Can you not just use QCoreApplication if you do not have a GUI?

Sean




More information about the Qt-interest-old mailing list