TypeError:PySide.QtCore.QObject.connect():没有足够的参数

时间:2015-08-26 21:47:00

标签: python qt pyside qthread qt-signals

我尝试从progressBar发出信号以更新class Signal(QtCore.QObject): this = QtCore.Signal(int) class Load(QtCore.QThread): def __init__(self, parent): QtCore.QThread.__init__(self, parent) self.parent = parent self.onProgress = Signal() def run(self): ''' ''' stacks = [] count = 100 for i in range(count): # do something ... self.onProgress.this.emit(count)

    def __init__(self ... ):
            ...
            self.Thread = Load(self)
            self.Thread.onProgress.connect(self.onProgress)
            self.Thread.start()

    @QtCore.Slot(int)
    def onProgress(self, int):
        self.ui.progressBar.setValue(self.ui.progressBar.value() + (90/int))

我如何在MainWindow中调用它

TypeError: PySide.QtCore.QObject.connect(): not enough arguments

但我总是收到此错误

PM> Get-Migrations
Retrieving migrations that have been applied to the target database.
201508242303096_Bad_Migration
201508211842590_The_Migration_applied_before_it
201508211440252_And_another

0 个答案:

没有答案