Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Should a custom QtMessageHandler be thread-safe ?



  • Hi all, I've been digging through the documentation and can't find if a custom QtMessageHandler has to be thread-safe in its implementation.
    Are the thread-safety issues already taken care of by the framework ?
    Thanks in advance for your answers!


  • Lifetime Qt Champion

    Hi,

    AFAIR, you have to take care of thread safety. The documentation states that when nothing is said about thread safety/reentrance then it should be considered as not safe.

    IIRC, qDebug uses a QTextStream which is not thread safe


Log in to reply