如何将std :: cout消息打印到QLabel或QTextBrowser

问题描述

|| 我正在尝试将所有控制台输出消息打印到QLabel或QTextbrowser。 有谁知道如何做到这一点? 谢谢你的帮助, 简历     

解决方法

        我在http://lists.trolltech.com/qt-interest/2005-06/thread00166-0.html找到了一种解决方案,该解决方案允许使用以下语法:
QDebugStream qout(std::cout,myTextEdit);
std::cout << \"Send this to the Text Edit!\" << endl;
希望对您有用。如果这与您的意思不完全相同,则可以根据具体情况进行调整。