0
두 클래스가 있습니다. 하나는 mainWindow 클래스이고 다른 하나는 진행 바를 업데이트하는 스레드입니다.MainWindow에 스레드 신호 연결
나는이 같은 신호/슬롯 구조를 사용하고있는 진행 막대를 업데이트하려면 : (I 관련 코드를 보여) : 나는 확실하지 않다
import threading
from PyQt4 import QtCore, QtGui, Qt
class MyThread(threading.Thread):
mySignal = QtCore.pyqtSignal(int, int)
def __init__(self,*args):
threading.Thread.__init__(self)
class Form1(QtGui.QMainWindow):
def __init__(self, parent=None):
QtGui.QWidget.__init__(self, parent)
self.ui = Ui_MainWindow()
self.ui.setupUi(self)
...
...
@pyqtSlot(int, int)
def updateProgress(self, arg1, arg2):
print "TEST Argument1: ", arg1
print "TEST Argument2: ", arg2
def my_function(self):
mt = MyThread(*args)
mt.mySignal .connect(self.updateProgress)
mt.start()
그리고이 무엇입니까 이해하기 :
mt.mySignal .connect(self.updateProgress)
TypeError: pyqtSignal must be bound to a QObject, not 'MyThread'
완벽하게 작동했습니다. 감사합니다. 코드에서의 작은 변화가 어떻게 변화하는지 놀랍습니다 .... 사실 몇 줄의 변경으로 충돌이 발생했습니다. – codeKiller