got this
#include <QThread>
class SerialThread
: public QThread{
Q_OBJECT
public:
protected:
void run();
signals:
};
#include <QThread>
class QString;
class SerialThread : public QThread
{
Q_OBJECT
public:
SerialThread(QObject *parent = 0);
protected:
void run();
signals:
void testowy(QString);
};
To copy to clipboard, switch view to plain text mode
while putting signal-slot mechanism to deliver some data from thread to my main its enough to do something like this in main thread as i got
SerialThread thread;
(...)
(...)
connect(&thread, SIGNAL(testowy(QString)),msg,SLOT(append(QString)));
To copy to clipboard, switch view to plain text mode
but i would like also to send a QString from main thread to thread
I could call something like thread.publicFunction(QString) from main but i wonder if its a propper way
Bookmarks