From 6940f4fd46462bae41811d4e337e6f1b6b7ecf6c Mon Sep 17 00:00:00 2001 From: gabime Date: Wed, 7 Jun 2023 00:29:23 +0300 Subject: [PATCH] Added some comments to qt_sinks.h --- include/spdlog/sinks/qt_sinks.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/include/spdlog/sinks/qt_sinks.h b/include/spdlog/sinks/qt_sinks.h index c5cb8d64..435e7d35 100644 --- a/include/spdlog/sinks/qt_sinks.h +++ b/include/spdlog/sinks/qt_sinks.h @@ -4,9 +4,10 @@ #pragma once // -// Custom sink for QPlainTextEdit or QTextEdit and its childs(QTextBrowser... -// etc) Building and using requires Qt library. +// Custom sink for QPlainTextEdit or QTextEdit and its childs(QTextBrowser...etc) +// Building and using requires Qt library. // + // 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, // and then use a standard signal/slot. @@ -30,6 +31,8 @@ template class qt_sink : public base_sink { 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) { // store the meta method object for later usage