
Originally Posted by
jpn
What are you trying to do? You must not touch GUI in a worker thread:
just gave a guess but didnt try it this way...
i made something like this
class SerialThread
: public QThread{
Q_OBJECT
public:
{
GUI=mainGUI;
}
protected:
void run()
{
connect(GUI,SIGNAL(),this,SLOT());
exec();
}
private:
(...)
};
class SerialThread : public QThread
{
Q_OBJECT
public:
SerialThread(QObject *mainGUI, QObject *parent = 0)
{
GUI=mainGUI;
}
protected:
void run()
{
connect(GUI,SIGNAL(),this,SLOT());
exec();
}
private:
QObject *GUI;
(...)
};
To copy to clipboard, switch view to plain text mode
and while creating a thread
SerialThread *thread=new SerialThread(this);
SerialThread *thread=new SerialThread(this);
To copy to clipboard, switch view to plain text mode
Bookmarks