Utils: Add documentation for Environment::originalSystemEnvironment()

Change-Id: I7791f0b111f5728bd21d2870d6a6793b433d9b37
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
Christian Kandeler
2025-04-24 13:38:15 +02:00
parent 02e6b5ecbc
commit accd2609da

View File

@@ -200,6 +200,8 @@ void Environment::prependOrSetLibrarySearchPaths(const FilePaths &values)
This can be different from the system environment that \QC started in if the
user changed it in \uicontrol Preferences > \uicontrol Environment >
\uicontrol System > \uicontrol Environment.
\sa originalSystemEnvironment()
*/
Environment Environment::systemEnvironment()
@@ -208,6 +210,17 @@ Environment Environment::systemEnvironment()
return *staticSystemEnvironment();
}
/*!
Returns \QC's original system environment.
This is the full, unmodified environment that \QC was started with.
Use this environment to start processes that are built alongside \QC
and thus have the same library dependencies. This is particularly
relevant if \QC was started via Squish or another instance of \QC,
i.e. in testing or development contexts.
For all other processes, use \l systemEnvironment() or more specialized
variants such as the build environment, if applicable.
*/
const Environment &Environment::originalSystemEnvironment()
{
static const Environment env(QProcessEnvironment::systemEnvironment().toStringList());