mirror of
https://github.com/gabime/spdlog.git
synced 2024-11-15 16:35:45 +08:00
Added some comments to qt_sinks.h
This commit is contained in:
parent
1f1897e3a4
commit
6940f4fd46
@ -4,9 +4,10 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
//
|
//
|
||||||
// Custom sink for QPlainTextEdit or QTextEdit and its childs(QTextBrowser...
|
// Custom sink for QPlainTextEdit or QTextEdit and its childs(QTextBrowser...etc)
|
||||||
// etc) Building and using requires Qt library.
|
// Building and using requires Qt library.
|
||||||
//
|
//
|
||||||
|
|
||||||
// Warning: the qt_sink won't be notified if the target widget is destroyed.
|
// Warning: the qt_sink won't be notified if the target widget is destroyed.
|
||||||
// If the widget's lifetime can be shorter than the logger's one, you should provide some permanent QObject,
|
// If the widget's lifetime can be shorter than the logger's one, you should provide some permanent QObject,
|
||||||
// and then use a standard signal/slot.
|
// and then use a standard signal/slot.
|
||||||
@ -30,6 +31,8 @@ template<typename Mutex>
|
|||||||
class qt_sink : public base_sink<Mutex>
|
class qt_sink : public base_sink<Mutex>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
// qt object is the object that receives the log messages (e.g QPlainTextEdit or QTextEdit)
|
||||||
|
// meta_method_name is the name of the slot to be called on the qt_object for every log message (e.g "append(QString)").
|
||||||
qt_sink(QObject *qt_object, const std::string &meta_method_name)
|
qt_sink(QObject *qt_object, const std::string &meta_method_name)
|
||||||
{
|
{
|
||||||
// store the meta method object for later usage
|
// store the meta method object for later usage
|
||||||
|
Loading…
Reference in New Issue
Block a user