How can I set PATH variable using QT?
问题 How can I get and set PATH variable using QT 4.8? I know I can get PATH variable values using getenv from the STL but don't know how to set it using STL or any Qt based method? If QT has a function for it, I would like to know and use it rather than going and using Windows API for it. 回答1: You can use setenv from stdlib.h to set PATH to a new value. setenv("PATH","/new/path/value",1) However, this is a non-standard extension to the standard headers, and will only affect sub-processes spawned