小编Gio*_*gio的帖子

PyQt6:Qt 模块枚举引发 AttributeError

我需要将以下代码从 PyQt5 (它在那里工作)转换为 PyQt6:

self.setWindowFlags(Qt.FramelessWindowHint)
Run Code Online (Sandbox Code Playgroud)

这是错误:

AttributeError: type object 'Qt' has no attribute 'FramelessWindowHint'
Run Code Online (Sandbox Code Playgroud)

我已经尝试过这个:

self.setWindowFlags(Qt.WindowFlags.FramelessWindowHint)
Run Code Online (Sandbox Code Playgroud)

它说:

AttributeError: type object 'Qt' has no attribute 'WindowFlags'
Run Code Online (Sandbox Code Playgroud)

python enums pyqt attributeerror pyqt6

5
推荐指数
1
解决办法
5556
查看次数

标签 统计

attributeerror ×1

enums ×1

pyqt ×1

pyqt6 ×1

python ×1