diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2016-08-03 16:12:32 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2017-03-21 18:46:46 +0000 |
commit | ceb859bf036dfdd1c54eec403006eac62a0d09b8 (patch) | |
tree | da78830719637ab469225b82eb4321019986ef62 /src/corelib/global/qglobal.cpp | |
parent | 6445aa4b064931cda36243aafc1600915fac093e (diff) |
Implement a counted QT_FATAL_WARNINGS
[ChangeLog][QtCore][Logging] If you set QT_FATAL_WARNINGS to a number
greater than 1, Qt will stop the application at that nth warning,
instead of on the first one. For compatibility reasons with previous
versions, if the variable is set to any non-empty and non-numeric value
different from 0, Qt will understand as "stop on first warning".
Change-Id: I0031aa609e714ae983c3fffd14676f1826f34600
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src/corelib/global/qglobal.cpp')
-rw-r--r-- | src/corelib/global/qglobal.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 6dba733fb4..871810e5a3 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -4419,8 +4419,11 @@ bool QInternal::activateCallbacks(Callback cb, void **parameters) stderr. Under Windows, the message is sent to the debugger. On QNX the message is sent to slogger2. This function does nothing if \c QT_NO_WARNING_OUTPUT was defined - during compilation; it exits if the environment variable \c - QT_FATAL_WARNINGS is not empty. + during compilation; it exits if at the nth warning corresponding to the + counter in environment variable \c QT_FATAL_WARNINGS. That is, if the + environment variable contains the value 1, it will exit on the 1st message; + if it contains the value 10, it will exit on the 10th message. Any + non-numeric value is equivalent to 1. This function takes a format string and a list of arguments, similar to the C printf() function. The format should be a Latin-1 |