Quote Originally Posted by wysota View Post
Could you set break points in your code using a debugger and check where exactly does you application spin all the time? Alternatively run your application under a profiler (such as callgrind or gprof) and see what takes the most time.
Aah, i found the cause of the problem. I compiled the program with -pg option and used gprof to check which API was taking all the CPU time.

I found that it was QAbstractItemView::timerEvent(QTimerEvent * event). I wanted the contents of the table rows to scroll so i implemented a timer by subclassing QAbstractItemView::timerEvent(QTimerEvent * event) in my class. But due to this, the CPU usage goes high.

I think i'll use a normal QTimer instead of reimplementing QAbstractItemView::timerEvent(QTimerEvent * event).

Don't know why QAbstractItemView::timerEvent(QTimerEvent * event) is causing this problem though.