Accessing Environment Variables
Hi,
I'm trying to find a way of accessing some environment varibles. I thought I saw something somewhere in the docs about it, but I didn't see anything in QApplication.
I hope to get out of doing a QProcess env command and searching through the results.
Thanks!
Re: Accessing Environment Variables
How about ::getenv()? It should be implemented even on windows.
Re: Accessing Environment Variables
You can also use the third argument to the main() function, just remember you get a copy of environment there.
Re: Accessing Environment Variables
Quote:
Originally Posted by
jacek
How about ::getenv()? It should be implemented even on windows.
In Windows:
Note: getenv is deprecated; consider using getenv_s instead
You expected MS to break the mold, right? :p
Re: Accessing Environment Variables
Thanks !! getenv works great.
getenv_s must be windows because I can't compile with that command.
Re: Accessing Environment Variables
You folks are Qt addicts aren't you? So , how about using qgetenv() instead? It provides portability and same features as the classic getenv() ...
Re: Accessing Environment Variables
The only issue about qgetenv is that it is only defined in Qt version 4.X.