如果想输出DEBUG信息:
Qt代码
qDebug() << "Date:" << QDate::currentDate();
qDebug() << "Types:" << QString("String") << QChar('x') << QRect(0, 10, 50, 40);
qDebug() << "Custom coordinate type:" << coordinate;
qDebug() << "Date:" << QDate::currentDate();
qDebug() << "Types:" << QString("String") << QChar('x') << QRect(0, 10, 50, 40);
qDebug() << "Custom coordinate type:" << coordinate;
如果想使用,COUT/IN需要使用QTextStream的重载
Qt代码
#include <QApplication>
#include <QTextStream>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QTextStream out(stdout);
out << "is QTextStream out " << endl;
return app.exec();
}

本文介绍了如何在Qt环境中输出DEBUG信息,并通过COUT/IN功能进行基本的数据输入输出操作。重点讲解了QTextStream类的使用方法,包括输出日期、类型、字符串、字符和矩形等数据类型。

1619

被折叠的 条评论
为什么被折叠?



