环境:python 3.4.2 WIN32版本
eric6-6.0.3 (小提示:中文汉化 ,汉化包安装完成后,点击eric6的settings ->Preferences->Interface->interface 的面板中滚动条往下选择Language 选中文zh_CN.GB2312 重启)
PyQt5.5.1
在点击生成对话框代码时弹出错误对话框信息如下:
arguments did not match any overloaded call:
QByteArray(): too many arguments
QByteArray(int, str): argument 1 has unexpected type ‘str’
QByteArray(QByteArray): argument 1 has unexpected type ‘str’
——————————————————————————–
File “D:\Program Files\Python\Python34\Lib\site-packages\eric6\Project\ProjectFormsBrowser.py”, line 840, in __generateDialogCode
dlg = CreateDialogCodeDialog(fn, self.project, self)
File “D:\Program Files\Python\Python34\Lib\site-packages\eric6\Project\CreateDialogCodeDialog.py”, line 128, in __init__
self.__updateSlotsModel()
File “D:\Program Files\Python\Python34\Lib\site-packages\eric6\Project\CreateDialogCodeDialog.py”, line 292, in __updateSlotsModel
QByteArray(“p{0:d}”.format(index))
——————————————————————————–
错误原因:QByteArray参数不匹配 ,尝试改成下面形式无果
QByteArray(index,"p{0:d}".format(index))
解决方法:
用编译工具直接打开D:\Python34\Lib\site-packages\eric6\Project\CreateDialogCodeDialog.py 文件
找到192行:如下面描述
直接注释对parameterNames的相关操作
parameterNames = metaMethod.parameterNames()
#if parameterNames:
#for index in range(len(parameterNames)):
#if not parameterNames[index]:
# parameterNames[index] = QByteArray(index,"p{0:d}".format(index))
192行 # QByteArray(index,"p{0:d}".format(index))
关闭,再次运行,正常弹出生成对话框