Using QSqlQueryModel in another thread and access it from main thread?
-
I'm not good at multithread programming so I really need someone who will shed some light for me on the way to do this.
My program is updating database frequently and each time the database is updated, the QSqlQueryModel also needs to be re-query as well to reflect the change. So I think if I leave the query model in another thread, the UI will not be blocked until the query is done.
Note: My program is QML-based. The query models need to be passed directly to the QML object by pointer. So how do I access QSqlQueryModel from another thread from main thread by pointer? Or may be this is just impossible, in which case, I also need you guys to help me out.