Qt 5.4 - QT_MESSAGELOGCONTEXT

Switching from Qt 5.3 to 5.4, all of a sudden my custom message handler gets neither line number nor file name from Qt libraries that use qDebug (), qWarning () and qCritical ().

Documents show that this was a change in Qt 5.4. To get this information, you must explicitly define QT_MESSAGELOGCONTEXT. So I did. I downloaded the Qt 5.4 source code, configured it, compiled and installed my code using the new libraries. The problem is that I still do not get the file name and line number.

This is how I configure the Qt build:

configure.bat -platform win32-msvc2010 -debug-and-release -nomake examples -nomake tests -opensource -opengl desktop -c++11 -no-strip -D QT_MESSAGELOGCONTEXT
+3
source share
1 answer

You do not need to rebuild Qt with this definition, you need to create an application with the definition included.

: ( , ) , .

, , . , - , .


, .pro -

DEFINES += QT_MESSAGELOGCONTEXT

qmake .

+5

All Articles