Doc: Change Q_CHECK_PTR documentation to match implementation

Task-number: QTBUG-9134
Change-Id: I417be34f5682fa23b7b76131f5713b0917dfae6d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
bb10
Rainer Keller 2015-02-25 11:05:29 +01:00
parent 9dd0bb851b
commit 8c9d6a334c
1 changed files with 7 additions and 4 deletions

View File

@ -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: