我第一次尝试在 PyQt 中使用 emit。我已经做了很多阅读和谷歌搜索,我确信我的回答是正确的,但我不断收到下面显示的错误。谁能阐明我做错了什么。
def checkRiskDescription(obj,form):
complete = True
if str(form.txtTitle.text()) == "":
complete = False
if len(str(form.txtOverview.toPlainText())) < 50:
complete = False
bar = form.tabRiskMain.tabBar()
if complete:
#Change Risk Description tab to Green
bar.setTabTextColor(0,QtGui.QColor(38, 169, 11, 255))
form.btnSave.enabeld = True
else:
#Change risk Description tab to Red
bar.setTabTextColor(0,QtGui.QColor(255, 0, 0, 255))
form.btnSave.enabled = False
QtGui.QWidget.emit(QtCore.SIGNAL("tabsUpdated"))
这是错误
File "D:\Development\python\PIF2\PIF\risk\risk.py", line 360, in checkRiskDescription
QtGui.QWidget.emit(QtCore.SIGNAL("tabsUpdated"))
TypeError: QObject.emit(SIGNAL(), ...): first argument of unbound method must have type 'QObject'