lundi 5 décembre 2016

Redirecting QThread cout Output to QStatusBar? C++

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.

Aucun commentaire:

Enregistrer un commentaire