关于某个PyQt5系列教程“'QMainWindow' object has no attribute”的错误修正
来源:互联网 发布:什么数据库8000多 编辑:程序博客网 时间:2024/06/14 15:33
原文地址:http://www.cnblogs.com/tkinter/p/5632245.html
一直到运行main程序之前之前都没有什么错误;
但是运行后出错:
python IDLE报错:
self.pushButton.clicked.connect(MainWindow.firstPyQt5_button_click)
AttributeError: 'QMainWindow' object has no attribute 'firstPyQt5_button_click'
改正方法:将firstPyQt5.py中的self.pushButton.clicked.connect(MainWindow.firstPyQt5_button_click)
更正为:self.pushButton.clicked.connect(self.firstPyQt5_button_click)
错误原因:不能完全说是教程错误,感觉也有可能是自己操作问题
根本原因就是因为传参错误,将窗口本身的函数赋值给了父类的MainWindow(python学的不精,个人猜测)
欢迎拍砖
阅读全文
0 0
- 关于某个PyQt5系列教程“'QMainWindow' object has no attribute”的错误修正
- PyQt5系列(三)Python3.x AttributeError: module 'string' has no attribute 'maketrans'错误解决
- 关于Srapy框架运行的错误AttributeError: 'module' object has no attribute 'OP_NO_TLSv1_1'
- AttributeError: 'NoneType' object has no attribute 'execute' 错误的解决
- 'function' object has no attribute '_name_'错误
- 关于python3.2的'dict' object has no attribute 'iteritems'
- 关于Python的:'module' object has no attribute 'inet_pton'问题解决
- yum错误'module' object has no attribute 'iterparse'解决方法
- python 3.x 错误 ‘generator’ object has no attribute ‘next’
- openstack:''Client'' object has no attribute ''service_catalog''错误
- [python错误]builtins.AttributeError: 'module' object has no attribute 'request'
- python 3.2 错误 ‘generator’ object has no attribute ‘next’
- python 编译错误TypeError: 'builtin_function_or_method' object has no attribute '__getitem__'
- python 3.x 错误 ‘generator’ object has no attribute ‘next’
- python 错误解析 AttributeError: 'module' object has no attribute 'dumps'
- 出现错误如下:AttributeError: 'module' object has no attribute 'SSL_ST_INIT'
- python 3.x 错误 ‘generator’ object has no attribute ‘next’
- Python 错误:AttributeError: 'module' object has no attribute
- 创建Spring Boot第一个引用项目出现的Bug
- Banner 无线轮播图
- 二叉树的深度
- 网络请求框架 Retrofit 2 使用入门
- 分布式id生成
- 关于某个PyQt5系列教程“'QMainWindow' object has no attribute”的错误修正
- idea 远程dubug
- 我的秋招总结(百度,搜狗,京东,美团,科大讯飞,新华三,国家互联网应急中心,微盟,ofo面经)
- 欢迎使用CSDN-markdown编辑器
- 使用Redis作为LRU缓存
- 基于RISC-V架构的开源处理器及SoC研究综述(三)
- ExtJS Ext.MessageBox
- 最大连续子数组和
- Intellij IDEA war exploded update classes and resources