At first, I only focused on the new way how QThreads should be used with QT4 ( Link ) by creating a QObject and then calling moveToThread() , which is very similar to my first code example (at least as I understood it). However, I simply could not understand why I could not pass the signals from QThread to the main application.
Since I really needed a quick solution to my problem, I desperately tried different things. Here is the second code that seems to work the way I wanted:
from PyQt4 import QtCore, QtGui import time import sys import math class SerialCon(QtCore.QThread): received = QtCore.pyqtSignal(object) def __init__(self, parent=None): QtCore.QThread.__init__(self)
I find this a workaround, but it really doesn't answer me. Also, as mentioned earlier in the QT blog entry, this does not mean that you are using QThread . So I'm still wondering how to get the first code in my question to work as expected. If you have some ideas about what's wrong with my first code, let me know!
source share