summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qglobal.cpp
diff options
context:
space:
mode:
authorRainer Keller <rainer.keller@theqtcompany.com>2015-02-25 11:05:29 +0100
committerRainer Keller <rainer.keller@theqtcompany.com>2015-03-12 12:45:01 +0000
commit8c9d6a334c695aea2ea6492466bb5b0e6f26c17d (patch)
tree454bfadcd672d14ca4c7c7d559d12a3e717b4696 /src/corelib/global/qglobal.cpp
parent9dd0bb851b34fcfea5e9be106d8f4209d59d5bf5 (diff)
Doc: Change Q_CHECK_PTR documentation to match implementation
Task-number: QTBUG-9134 Change-Id: I417be34f5682fa23b7b76131f5713b0917dfae6d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/global/qglobal.cpp')
-rw-r--r--src/corelib/global/qglobal.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index 7913af3103..abd9f4f593 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -2813,12 +2813,15 @@ QString QSysInfo::prettyProductName()
\macro void Q_CHECK_PTR(void *pointer)
\relates <QtGlobal>
- If \a pointer is 0, prints a warning message containing the source
+ If \a pointer is 0, prints a message containing the source
code's file name and line number, saying that the program ran out
- of memory.
+ of memory and aborts program execution. It throws \c std::bad_alloc instead
+ if exceptions are enabled.
- Q_CHECK_PTR does nothing if \c QT_NO_DEBUG was defined during
- compilation.
+ Q_CHECK_PTR does nothing if \c QT_NO_DEBUG and \c QT_NO_EXCEPTIONS were
+ defined during compilation. Therefore you must not use Q_CHECK_PTR to check
+ for successful memory allocations because the check will be disabled in
+ some cases.
Example: