Browser for QDebug output

From Qt Wiki
Revision as of 14:05, 14 January 2015 by Maintenance script (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

A Browser for QDebug Log Output

The code on this page shows how a simple log browser can be added to an application.

It consists of the actual log browser (class LogBrowserDialog in logbrowserdialog.h and logbrowserdialog.h) and a small wrapper (class LogBrowser in logbrowser.h and logbrowser.h). The wrapper is instantiated in the main function of an application and creates the browser window. It also acts as an intermediary and converts the const char * based messages from the debug system into QString based messages. With this trick the debug messages can be sent to the actual browser by the means of signal/slot connections. This adds basic thread support to the browser.

logbrowser.pro

logbrowser.h

logbrowser.cpp

logbrowserdialog.h

logbrowserdialog.cpp

main.cpp

Categories: