View Full Version : Thread-safety of QGraphicsView::items.

22nd February 2011, 12:23
Hi all!

I can't find this information anywhere else, so I'll just ask this small question here: is QGraphicsView::items (http://doc.trolltech.com/4.7/qgraphicsview.html#items-5) thread-safe?

If it isn't, which I fear, is a wrapper around it with a QMutex to prevent simultaneous access enough, or is ALL use of QGraphicsView forbidden in concurrent threads?

Thanks in advance for your time!

22nd February 2011, 12:31
You cannot access any widget from a non-gui thread. You cannot access any QObject from more than one thread. There is no way to work around this with mutexes. Use signals and slots or events for synchronization.

22nd February 2011, 13:24
Ok, thanks for the quick answer!