QCppUnit is a free and open source framework to perform unit testing, as described for example in Extrem Programming.
The QCppUnit framework uses Qt to display the result of the tests and contains an example that shows how to test a Qt application, even on user behavior.