[Qt-interest] Insert item to QTableWidget increases the CPU usage!

Jack Mack jackmack2000de at yahoo.de
Tue Jun 1 10:26:07 CEST 2010


Hi all,

I develop a simple sniffer programm for incoming data via socket or shared memory. I want to show the data about a table. Therefore I use the QTabWidget and call setItem().

It works fine if the data arrived slowly. Slowly means greater than 1 second. But under real conditions the data arrives in ms (milli seconds).

I have simulated this with a QTimer::setIntervall(200), using the timeout() slot to insert the items. But then the CPU usage of my app increases to 11%. That's not good.

I have tried some solutions like setUpdatesEnabled(false) but it makes no diffrence.
I don't want to use an "update thread" like pushing all data to an list and the thread reads out this list and inserts the items. This means that if the thread is slower than pushing data to list increases the list more and more.

Have anybody an idea how I can solve that problem?

Thanks
jack



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100601/9f5340b9/attachment.html 


More information about the Qt-interest-old mailing list