22 #include "MSThread.hpp" 35 MC_LOG(
"this: %p obj: %p obj thread: %p",
this, &
object,
object.thread());
38 MC_WARNING(
"The object has been moved to this thread already!");
42 object.moveToThread(
this);
52 MC_LOG(
"Move object (%p) to its original thread (%p -> %p)",
53 iter.key(),
this, iter.value());
54 iter.key()->moveToThread(iter.value());
58 MC_WARNING(
"No object is registered to move back to its original thread.");
bool IsEmpty()
Whether object is attached to the thread.
#define MC_WARNING(...)
Warning macro.
void AddObject(QObject &object)
Add an object to this thread.
void RemoveObjects()
Move the objects back to their original thread.
QMap< QObject *, QThread * > ObjectThreads
Remember for the original thread of the moved objects.
#define MC_LOG(...)
Debug macro.
virtual void run() override
Run the thread.