I need to Start immediately and stop then a QThread extended class from Qml File. Is there any solution for that? here is my class :
class SerialManager : publi
if you have SerialManager like this:
class SerialManager : public QThread
{
Q_OBJECT
public:
CircularList buffer_[2];
signals:
void dataReady(short *value,int len,unsigned short sample);
protected:
void run();
};
in main.cpp add bellow code:
qmlRegisterType("Device",1,0,"Serial");
then in your qml do this:
Component.onCompleted: {
thread.start()
}
Component.onDestruction:
{
thread.quit()
}