You cannot access GUI objects (QTextEdit) from another thread (QThread::run()).
Instead send signal from the Serial_Port object and receive it from a slot of CVmThread.
You cannot access GUI objects (QTextEdit) from another thread (QThread::run()).
Instead send signal from the Serial_Port object and receive it from a slot of CVmThread.
When you know how to do it then you may do it wrong.
When you don't know how to do it then it is not that you may do it wrong but you may not do it right.
Or the other way around, depending on which of the two classes produces the data and which one consumes it.
So instead of calling setPlainText() on the text edit you would emit a signal carrying a QString and connect that to the setPlainText() slot or to a slot that in turn calls setPlainText()
Cheers,
_
P.S.: even if it weren't for the threading issue, accessing some other classes internal members is almost always a bad idea. Methods in Serial_Port that then all methods if Serial_Port internals is way cleaner
Bookmarks