diff --git a/README.md b/README.md index d7434356..2b02422f 100644 --- a/README.md +++ b/README.md @@ -420,6 +420,21 @@ void replace_default_logger_example() } ``` +--- +#### Log to Qt with nice colors +```c++ +#include "spdlog/spdlog.h" +#include "spdlog/sinks/qt_sinks.h" +MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) +{ + setMinimumSize(640, 480); + auto log_widget = new QTextEdit(this); + setCentralWidget(log_widget); + auto logger = spdlog::qt_color_logger_mt("qt_logger", log_widget); + logger->info("Some info message"); +} +``` + --- ## Benchmarks