On 18/01/2019 11:06, Alexander Dyagilev wrote:
The previous problem I recently wrote about was caused by me thinking that QObject::disconnect also destroys all queued events caused by this connection. This was obviously wrong.

But, I still want Qt to behave so. Is there a way to achieve such behavior?

You can explicitly specify that the connections should be Qt::BlockingQueuedConnection rather than using the default (which is Qt::AutoConnection, meaning the connections are queued connections for objects in different threads.)

Heed the warning about deadlocks:

http://doc.qt.io/qt-5/qt.html#ConnectionType-enum

Another solution would be to use Qt::DirectConnection, but then you need to make the slot(s) thread-safe and be careful not to call functions that are not supposed to be called from a non-UI thread or functions that are not thread safe.

All in all though, you current design sound wonky.

_______________________________________________
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest

Reply via email to