4std::streamsize QDebugStream::xsputn(
const char *p, std::streamsize n) {
5 QMutexLocker locker(m_mutex);
6 m_string.append(p, p + n);
9 while (pos != std::string::npos) {
10 pos = m_string.find(
'\n');
11 if (pos != std::string::npos) {
12 std::string tmp(m_string.begin(), m_string.begin() + pos);
13 m_text.append(tmp.c_str()).append(
"\n");
14 m_string.erase(m_string.begin(), m_string.begin() + pos + 1);
17 QCoreApplication::postEvent(
this,
new QEvent(QEvent::User));
34std::streambuf::int_type QDebugStream::overflow(int_type v) {
35 QMutexLocker locker(m_mutex);
37 m_text.append(m_string.c_str()).append(
"\n");
38 m_string.erase(m_string.begin(), m_string.end());
42 QCoreApplication::postEvent(
this,
new QEvent(QEvent::User));