[Qt-qml] Component loading in background thread?

Cornelius Hald hald at icandy.de
Fri Nov 19 11:17:45 CET 2010


Hi,

is there a way to load a complex component with low priority in the
background?

I'm exposing a complex QGraphicsWidget to QML and the problem is, that
whenever I load that component my application freezes for a second (on
desktop, on mobile it's much longer). 

I'd like to display a lightweight 'loading' animation and load that
component in the background without freezing the interface. Then
whenever it's ready it should replace the animation with the real
content.

I've tried using a loader but whenever that kicks in the interface still
freezes. Is there another option? Should I use QThreads on the C++ side?
Or a WorkerScript in QML?

Thanks for all pointers!
Conny





More information about the Qt-qml mailing list