When should moveToThread
be preferred over subclassing QThread
?
This link shows that both methods work. On what basis should I decide what to u
Simple answer is ALWAYS. When you move object to thread:
When you subclass QThread
There is full description of the problem from Qt blog: You’re doing it wrong….
QtConcurrent::run
is also very handy.
Please remember that by default slots are trying to jump between treads when signal is send from other thread object is assigned to. For details see documentation of Qt::ConnectionType.