[Development] Modifying and accessing environment variables in Qt

Kevin Kofler kevin.kofler at chello.at
Sun May 10 16:34:23 CEST 2015

Marc Mutz wrote:
> Tests are presumably easy. If everything else fails, QtTest could execute
> itself anew for each test. After a quick scan, the only thing I'm worried
> about in QtBase is qglxconvenience.cpp, which temporarily modifies the
> environment.

That would be my code. The environment is only modified if 
QT_XCB_FORCE_SOFTWARE_OPENGL is set, a workaround for old OpenGL-1.x-only 
drivers. I simply do not know a better way to force Mesa's libGL to use 
software rendering in Qt applications without making it global for all 

There is no environment changing (and thus no race) in the common case where 
the workaround environment variable QT_XCB_FORCE_SOFTWARE_OPENGL is not set.

        Kevin Kofler

More information about the Development mailing list