mirror of
https://github.com/gabime/spdlog.git
synced 2025-01-26 15:39:03 +08:00
Delete qtextedit_sink_p.h
This commit is contained in:
parent
a19f4bba0c
commit
96ebef093f
@ -1,35 +0,0 @@
|
|||||||
// Copyright(c) 2015-present, Gabi Melman, mguludag and spdlog contributors.
|
|
||||||
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <QObject>
|
|
||||||
#include <QTextEdit>
|
|
||||||
|
|
||||||
namespace _spdlog_p {
|
|
||||||
namespace _sinks_p {
|
|
||||||
class qtextedit_sink_p : public QObject {
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
qtextedit_sink_p(QTextEdit *textedit = nullptr) {
|
|
||||||
if (textedit != nullptr) {
|
|
||||||
textedit_ = textedit;
|
|
||||||
connect(this, &qtextedit_sink_p::append_text, textedit_,
|
|
||||||
&QTextEdit::append);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
~qtextedit_sink_p() {}
|
|
||||||
|
|
||||||
void append(const std::string &str) {
|
|
||||||
emit append_text(QString::fromStdString(str));
|
|
||||||
}
|
|
||||||
|
|
||||||
signals:
|
|
||||||
void append_text(const QString &);
|
|
||||||
|
|
||||||
private:
|
|
||||||
QTextEdit *textedit_ = nullptr;
|
|
||||||
};
|
|
||||||
} // namespace _sinks_p
|
|
||||||
} // namespace _spdlog_p
|
|
Loading…
Reference in New Issue
Block a user