Multi-thread access QTreeView control
In my application, there are two thread that may be access one QTreeView control at the same time. Are there any mechanism in QT that can lock the control in whole or just lock one tree node before the accessing, to prevent possible conflictions between two threads?
You can access Widgets directly only from "main thread":http://qt-project.org/doc/qt-5/threads-qobject.html#qobject-reentrancy
[quote author="chcw" date="1408286029"]In my application, there are two thread that may be access one QTreeView control at the same time.[/quote]
Do you mean you need to modify data that is shown in QTreeView?
In this case you need to access the model of the QTreeView.
To make it multithreaded add slots that will accept modification to the model.
Connect then with the signals from both worker threads using "Queued Connection":http://qt-project.org/doc/qt-5/threads-qobject.html#signals-and-slots-across-threads
[EDIT]: "Multithreading Technologies in Qt":http://qt-project.org/doc/qt-5/threads-technologies.html