QTestLib has QBENCHMARK. See example here. But in case of painting performance you have to find alternative way or workarounds (paint event of widgets is synchronized with refresh rate of screen).
Once I did this kind of test by putting in graphics view lots of objects of one kind and animating some of them (I measured nr of paint event calls in 4 second period, nr of object was so big so frames per second were smaller then refresh rate of screen so I have warranty that I measure performance of my painting not screen refresh rate).
Bookmarks