2

How do I read the cout message written in a non-Qt codebase running within a QThread into QStatusBar?

Problems with existing methods:

  • Emitters would not work because the code that is sending cout messages is not based in Qt.
  • QProcess::readAll() will not work because this is a QThread, not a QProcess.
  • std::stringstream seems like it would require cout to be replaced (no big deal), but also the string to be read from the same file.
  • I cannot get these options to work due to build errors.
  • Windows solutions will not work - my OS is Ubuntu.
Community
  • 1
  • 1
Graeme Rock
  • 601
  • 5
  • 21
  • I found the answer here, enjoy!: http://stackoverflow.com/a/41047259/5095372 – Graeme Rock Jan 17 '17 at 16:23
  • Possible duplicate of [C++ Qt: Redirect cout from a thread to emit a signal](https://stackoverflow.com/questions/31317565/c-qt-redirect-cout-from-a-thread-to-emit-a-signal) – ymoreau Nov 10 '17 at 09:02

0 Answers0