why i can not call add item from other thread?
it give warning:
QObject::startTimer: timers cannot be started from another thread
QObject::killTimer: timers cannot be stopped from another thread
why i can not call add item from other thread?
it give warning:
QObject::startTimer: timers cannot be started from another thread
QObject::killTimer: timers cannot be stopped from another thread
How are you calling the timers ?
QGraphicsItem IS NOT inherited by QObject !
Qt Help tells us:
In your case QGraphicsScene::addItem must be called from the main thread. This is necessary because addItem may post events (e.g. for updating the views). The warning appears because the current implementation of QGraphicsScene::addItem starts a timer to do some indexing.QObject and all of its subclasses are not thread-safe. This includes the entire event delivery system. It is important to keep in mind that the event loop may be delivering events to your QObject subclass while you are accessing the object from another thread.
In other words: Manipulate GUI objects only in the main thread.
Use a queued connection to notify you scene that it should add an item.
Bookmarks