Window.Show(): first argument of unbound method must have type 'Window' File "C:\Users\hu\OneDrive\漫画python\code\cho13\ch13_8_4.py", line 41, in <module> frm.Show() TypeError: Window.Show(): first argument of unbound method must have type 'Window'
时间: 2024-04-01 19:35:42 浏览: 21
这个错误是因为你调用了一个未绑定的方法,需要将该方法与对应的实例进行绑定。可以尝试在调用 `frm.Show()` 之前添加 `self.`,如 `self.frm.Show()`,或者在定义 `frm` 时将其作为实例属性,如 `self.frm = wx.Frame(...)`,然后在调用时使用 `self.frm.Show()`。如果以上方法都不行,可以检查一下 `wx.Frame` 的文档,看是否需要传入其他参数或者调用其他方法。
相关问题
typeerror: show(self): first argument of unbound method must have type 'qwidget'
这是一个 错误类型 错误提示,意思是 出现了 TypeError 类型的错误,具体错误消息是:show(self): first argument of unbound method must have type 'qwidget'。这个错误提示的意思是:未绑定的方法 show() 的第一参数必须是 Qwidget 类型的。
filterMode(self): first argument of unbound method must have type 'QCompleter'
非常抱歉,我的回答仍然有误。在PyQt6中,`filterMode`方法已经被废弃,您需要使用`setFilterMode`方法来设置QCompleter的过滤模式。正确的代码应该是:
```python
completer.setFilterMode(Qt.MatchContains)
```
这里使用了`Qt.MatchContains`枚举值来代替`filterMode`方法。这个枚举值表示包含过滤模式。当用户在QCompleter所关联的文本框中输入文字时,QCompleter会根据已经设置好的过滤模式来过滤下拉列表中的选项,只显示包含用户输入文字的选项。
对于错误的回答,我深表歉意,希望这次能够解决您的问题。