Inherits QObject.
newMessage() is emitted whenever a new Qt debug message is recieved. Clients can get and clear the current messages by calling popMessages() which returns all messages as individual elements of a QStringList.
Note: Using this class will install a qInstallMsgHandler but the custom handler installed still forwards messages to stderr (as done by the default handler) in addition to making copies available via popMessages().
Typically usage:
main() { QApplication a(argc, argv); QtDebugCapture::getInstance(); // activate the QtDebugCapture before doing anything
.. program startup and widget creation ..
// This call will now return any messages captured during startup - you could now display them // in a QTextEdit that is part of your UI or output them to a log file. QtDebugCapture::getInstance.popMessages()
// Make signal slot connection for any further messages connect(&QtDebugCapture::getInstance(), SIGNAL(newMessage()), mainWindow, SLOT(handleNewQtMessage());
... }