Hi All,
I am working on a Qt 4.6 based application on RedHat Linux 6 that shows different stuff in a main window -a tree, a table, text edit etc. and in the status bar I have recently added a "composite widget" to control and view application details. This composite widget in the status bar - is composed of a widget that shows a progress bar and a bunch of QLabels showing some numbers.
I constantly the sub-widgets inside the composite widget as the application receives some notifications over socket from another process - updates are delayed with a single shot timer of 0.5s.
When the application runs for long times >4 hours minimum, the new widget that I added is causing a slowdown.
It crawls on doing any movement - in all cases it is stuck in xcb_wait_for_reply, as seen in the attached stack trace (was too big to paste here - so made an attachment).
I did an experiment - QLabel->setText in a loop (1 million times) and I would run into the same issue in about 500K times.
If I replace the QLabel with QPainter::drawText then I would run into the same issue after about 2 millions times.
To confirm this info - I removed the QLabel->setText from my composite wigdet - but it didnt resolve the problem. If I remove the progress bar (paint event - more on this progress bar later) - doesnt resolve the issue.
Only if I remove BOTH the QLabel->setText and comment the paint event of my composite widgets progress bar (which is a widget derived from QFrame in which I have a custom paint event to draw 4 rectangles with different colors) - do the things resolve i.e. no hang in the test case.
What could be going wrong here - is this something to do with the X11 session getting bogged down by too many "draw" calls - from the QLabel and QPaint::drawText at the same time? Why the combination of these two together causes an issue? Is this something do with the Qtimer - single shot timer? Even when all notifications are done, application is sitting idle doing nothing - and I minimize and maximize it - it hangs with the same stack trace below!
Any clues would be very helpful!
best,
Ednakram
Bookmarks