Greeting
I have a following class.
class MyClass : public QObject
{
Q_OBJECT
public:
Q_INVOKABLE QVariant status();
public:
MyClass(Cla
This is wrong in many ways:
QThread myClassThread;
MyClass * myClass = new MyClass(classX);
connect(&myClassThread, SIGNAL(started()), myClass, SLOT(init()));
myClass->moveToThread(&myClassThread);
myClassThread.start();
myClassThread object will be destroyed when this block of code ends.myClass has a parent. Object which are moved to thread can't have any parent. Only whole three of objects can be moved to threads