Howto connect QObject set as a QML contextProperty in a separate thread ?
Unsolved
General and Desktop
-
I've a QObject which updates values on a QML interface. In order to avoid GUI freezes I've moved the object to another thread i.e.
ClientListWrapper *clients = new ClientListWrapper; QThread *ClientListWrapper_thread = new QThread(); clients->moveToThread(ClientListWrapper_thread); ClientListWrapper_thread->start(); Engine.rootContext()->setContextProperty("clients", clients);
I'm using 'clients' as a model in my QML so the values on the interface are updated by the 'clients' object. But now QML doesn't recognize 'clients' because it is in a separate thread.
How should I approach this problem ?