Search This Blog

Sunday, June 28, 2009

Qt Debuging Tips

Output:
  • qDebug() : e.g. qDebug() << "Stuff:" <<>
  • qCritical(): e.g. qCritical("no more memory");
  • qFatal();
  • qWarning()
Assertion:
  • Q_ASSERT()
  • Q_ASSERT_X(): this can print the line where assertion fail
Check pointer:
  • Q_CHECK_PTR()
Run qmake again:
  • error like "vtbl, _vtbl": this might be related to meta-object compiler, check if using Q_OBJECT correctly, make sure the signal/slot syntax (declaration/implementation), and re-run qmake.
Also read the Qt 4.5 Debug Documentation.

No comments: