qDebug 是 Qt 所提供的 debug 函式。
【Example】
#include <QtGui/QApplication>
#include <QtDebug>
#include "mainwindow.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
qDebug() << "Show this via qDebug\n";
return a.exec();
}
【Result】
【說明】
- 基本用法
qDebug("Items in list: %d", myList.size()); - 要 include <QtDebug>
qDebug() << "Brush:" << myQBrush << "Other value:" << i;
【參考】
- void qDebug ( const char * msg, ... )
http://doc.trolltech.com/4.0/qtglobal.html#qDebug

