summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qglobal.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-04-12 20:08:56 +0200
committerLiang Qi <liang.qi@qt.io>2017-04-12 20:08:56 +0200
commit94c576cf6607d3e9880fdaf6c8a51216bf2d2147 (patch)
tree32e42bdb8bcb869c894023f9494c2e2df310d585 /src/corelib/global/qglobal.cpp
parent2ad7f6ddf5042d7442c97a89b083ca2853cf5721 (diff)
parente893e657e5c976f96e7e627ca90531934129bf4b (diff)
Merge remote-tracking branch 'origin/5.8' into 5.9
Diffstat (limited to 'src/corelib/global/qglobal.cpp')
-rw-r--r--src/corelib/global/qglobal.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index 6dba733fb4..1f93d3cbec 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -3183,12 +3183,16 @@ static QBasicMutex environmentMutex;
Returns the value of the environment variable with name \a
varName. To get the variable string, use QByteArray::constData().
+ To convert the data to a QString use QString::fromLocal8Bit().
\note qgetenv() was introduced because getenv() from the standard
C library was deprecated in VC2005 (and later versions). qgetenv()
uses the new replacement function in VC, and calls the standard C
library's implementation on all other platforms.
+ \warning Don't use qgetenv on Windows if the content may contain
+ non-US-ASCII characters, like file paths.
+
\sa qputenv(), qEnvironmentVariableIsSet(), qEnvironmentVariableIsEmpty()
*/
QByteArray qgetenv(const char *varName)