我使用PyQt4
并有以下代码:
QtCore.QObject.connect(self.process, QtCore.SIGNAL("finished(int,QProcess::ExitStatus)"), self.stop_run)
QtCore.QObject.connect(self.picker, QtCore.SIGNAL("finished()"), self.get_picked_control)
QtCore.QCoreApplication.instance().installEventFilter(QtCore.QAbstractEventDispatcher.instance())
QtCore.QObject.connect(self.ui.action_record, QtCore.SIGNAL("triggered()"), self.record)
QtCore.QObject.connect(self.ui.action_stop, QtCore.SIGNAL("triggered()"), self.stop_record)
QtCore.QObject.connect(self.ui.action_picker, QtCore.SIGNAL("triggered()"), self.pick_control)
但是,当我升级到PyQq5
时出现错误:
QtCore.QObject.connect(self.process, QtCore.SIGNAL("finished(int,QProcess::ExitStatus)"), self.stop_run)
AttributeError: type object 'QObject' has no attribute 'connect'
如何更改此行以用于PyQt5
?