I’m a QT newbie. I have a class extend from widget like:
class myclass: public Qwidget
{
Q_OBJECT
public:
void myfunction(int);
slots:
void myslot(int)
{
//Here I want to put myfunction into a thread
}
...
}
I don’t know how to do it. Please help me.
Add a
QThreadmember then inmyslotmove your object to the thread and run the function.My answer is basically the same as from this post: Is it possible to implement polling with QThread without subclassing it?