Re: Loading (e. g. a qtreeview) model data in a different thread
Originally Posted by dubbaluga
I'm not completely sure, but I would pass a reference of the QAbstractItemModel from the "main thread" to the "data preparing" thread. This thread (the latter) in turn adds QModelindex objects (as they contain the internal void* pointer) by value to e. g. the setData()-method of that model.
Could it work that way?
No, that's not a good idea. You should prepare the data in external thread and signal the model object that it can consume what's prepared for it so that the modification to the model happens in the main thread.
Your biological and technological distinctiveness will be added to our own. Resistance is futile.
Please ask Qt related questions on the forum and not using private messages or visitor messages.
Bookmarks