[Qt-interest] Smooth UI with large QTreeView

Wintaki Hagabashi wintaki at hotmail.com
Tue Mar 17 19:35:10 CET 2009


Hi,

I have a GUI app that has a QTreeView with a custom model (derived from QAbstractItemModel).  At the top of the screen, there is a custom widget that is basically a scrolling ticker.  It has a QTimer and every 20 milliseconds, it updates itself (scrolls left 2 pixels).

This all works great except that once every 3 seconds the data in my QTreeView updates.  The nature of this is that the QTreeView has about 3000 rows and about 100 of them update each second.  I make the changes to my internal data structure, and then emit dataChanged().  All working perfect, except that the updates seem to block the GUI thread for a short period of time, making the scrolling ticker "pause" for a split second, making it appear jerky.

Is there a way to do the scrolling in a different thread (or the updates to the QTreeView)?  As far as I understand all GUI operations must be done in a single thread.

I tried calling posting evens to do the QTreeView updates one at a time in the hope that it would get interleaved with the timer events, smoothing out the scrolling, but this did not seem to help.

Thanks for any tips

-wayne



_________________________________________________________________
Drag n’ drop—Get easy photo sharing with Windows Live™ Photos.

http://www.microsoft.com/windows/windowslive/products/photos.aspx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090317/5d788a8e/attachment.html 


More information about the Qt-interest-old mailing list