从PyQt4迁移到PyQt5

时间:2019-05-26 14:11:26

标签: python-3.x pyqt5 pyqt4

我使用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

0 个答案:

没有答案