qt - Why Q_ASSERT instead of assert -
q_assert
custom assert macro supposedly enhances standard assert
function.
the error message handled qfatal()
, can behave better on platforms standard assert macro. example on windows trigger visual studio debugger @ point assertion fails instead of calling abort()
.
you can redirect output of qt error message functions such qfatal
to custom message handler ( qinstallmessagehandler() ). can useful example if want redirect errors message file.
also note q_assert
disabled macro qt_no_debug
(while assert
disabled ndebug
) : can used separate asserts between qt-related code , rest.
Comments
Post a Comment