das Thema wurde hier wahrscheinlich schon sehr häufig durchgekaut; seh zwar das Problem aber nicht die Lösung momentan:
Code: Alles auswählen
class Mainwindow : public QMainWindow
{
Q_OBJECT
signals:
void TxPoll(quint8);
private:
MyThread *m_pTh;
};
void Mainwindow::StartThreads(void)
{
m_pTh= new MyThread(this);
//m_pTh->moveToThread(m_pTh);
m_pTh->start();
bool rtn = QObject::connect(this,
SIGNAL(TxPoll(quint8)),
m_pTh,
SLOT(OnTxPoll(quint8)),
Qt::QueuedConnection);
}
class MyThread: public QThread
{
Q_OBJECT
public slots:
void OnTxPoll(quint8 proto);
};
Das Problem liegt mit Sicherheit an m_pTh, weil diese im Mainthread dekaliert ist. mit movetothread geht es allerdings auch nicht.
Für eine Lösung des Problems wäre ich euch sehr dankbar
Gruß
saoirse