On ubuntu I can use the environment variables passed to main as the following, but it does not work on Windows since QT does not pass env in qtmain_win.cpp.
int main(int argc, char *argv[], char* env[])
{
//C:/Qt/4.6.3/src/winmain/qtmain_win.cpp does not provide env argument
#ifndef _MSC_VER
while(env[i])
{
BOOST_LOG_TRIVIAL(info) << env[i] ;
environment_variable_list.append(env[i]);
i++;
}
#endif
}
Actually QProcessEnvironment should be used for this purpose.
An interesting topic: Building static Qt on Windows with MSVC